CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Checkbox for Honor Roll in Personal Campaign Page
Pages: [1] 2

Author Topic: Checkbox for Honor Roll in Personal Campaign Page  (Read 2119 times)

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Checkbox for Honor Roll in Personal Campaign Page
February 21, 2013, 06:07:41 am
Hello,

Is there a way to make the check box for the "Show my support in the public honor roll" stay checked by default?

Thanks

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Checkbox for Honor Roll in Personal Campaign Page
February 21, 2013, 12:33:20 pm

You can do this via a jQuery snippet and attach it to the tpl via the extra.tpl file

u'll need some experience customizing civicrm. the book and blog have a fair bit of detail

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
February 21, 2013, 02:19:41 pm
Do you have links to were I can find the details? Or maybe post the answer on how to do it? All I need is a check box checked by default. I'm not coder by any means, but I can tweak some php. Have no idea about jQuery.

Any help would be greatly appreciated :)





Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
February 22, 2013, 03:29:53 am
See:

http://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates
http://book.civicrm.org/developer/current/techniques/templates/
http://civicrm.org/blogs/hershel/how-customize-civicrm-pages-jquery

That should do it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 01, 2013, 05:24:24 am
Thank you for the links but I'm still having trouble just getting this simple checkbox to be checked by default. Will this line of code work?

$("input[for='pcp_display_in_roll']").prop('checked', true);

And if so, how can I properly implement? I've tried adding it to the register.tpl like this: {literal}$("input[for='pcp_display_in_roll']").prop('checked', true);{/literal} but it just shows up as text on the page.

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
March 01, 2013, 05:26:52 am
That code is not right. Send me a URL to your page and I will help. Send it privately if you prefer.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 01, 2013, 06:05:10 am
Hi Hershel, thank you kindly...I just PM'd you the URL :)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
March 01, 2013, 06:46:45 am
Hi. Try this:

Code: [Select]
{literal}
<script>
cj("input#pcp_display_in_roll").prop('checked', true);
</script>
{/literal}
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 01, 2013, 02:15:05 pm
Hi Hershel,

That didn't work... I added the code to the register.tpl like this:

Code: [Select]
{if $pcp && $is_honor_roll}
    <fieldset class="crm-group pcp-group">
        <div class="crm-section pcp-section">
            <div class="crm-section display_in_roll-section">
                <div class="content">
                {literal}
<script>
cj("input#pcp_display_in_roll").prop('checked', true);
</script>
{/literal}
                    {$form.pcp_display_in_roll.html} &nbsp;
                    {$form.pcp_display_in_roll.label}       
                </div>
                <div class="clear"></div>

I use Text Wrangler to edit...it highlights code so you know it is entered properly. This line "input#pcp_display_in_roll" and this line 'checked' are greyed out so I think it may be missing something. Thank you for the help so far :)

P.S. I'm using CiviCRM on Joomla 2.5.8
« Last Edit: March 01, 2013, 02:23:01 pm by building252 »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
March 03, 2013, 05:56:31 am
Try putting it lower in the file--at the very end. And use:

Code: [Select]
{literal}
<script>
cj("input#pcp_display_in_roll").click();
</script>
{/literal}
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 04, 2013, 06:32:41 am
Ok, making progress for sure....the box is checked...only problem is the fields for Name and Personal note are still hidden.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
March 04, 2013, 06:35:18 am
I don't see it checked nor do I see the JS code on the page at all now.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 04, 2013, 07:35:16 am
Sorry, I took it off...didn't want people to get confused...It's on there now.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Checkbox for Honor Roll in Personal Campaign Page
March 04, 2013, 07:39:34 am
Try

Code: [Select]
{literal}
<script>
cj("input#pcp_display_in_roll").click();
pcpAnonymous();
</script>
{/literal}
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

building252

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.5.28
  • PHP version: 5.3.18
Re: Checkbox for Honor Roll in Personal Campaign Page
March 04, 2013, 08:07:01 am
AWESOME!!! It works, thank you so much for your help!!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Checkbox for Honor Roll in Personal Campaign Page

This forum was archived on 2017-11-26.