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 Profiles (Moderator: Dave Greenberg) »
  • Adding Help text to search profile
Pages: [1]

Author Topic: Adding Help text to search profile  (Read 1116 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Adding Help text to search profile
March 07, 2010, 03:26:45 pm
The patch adds per field and per profile search text to a search profile. This is generally useful to lots of people but I hesitate to submit it as a JIRA issue because it could have some unexpected effects on people who already had multi-functional profiles if the search text they wrote for a 'create' profile suddenly started showing up on their 'search' profile.

One option might be to add another setting to the profile as to whether the help text would show on the search profile



Code: [Select]
Index: templates/CRM/Profile/Form/Search.tpl
===================================================================
--- templates/CRM/Profile/Form/Search.tpl (revision 26464)
+++ templates/CRM/Profile/Form/Search.tpl (working copy)
@@ -36,6 +36,11 @@
         <div>
     {/if}
 
+    {assign var=field value=$fields|@reset}
+    {$field.groupHelpPre}
+  
+    <br />
+    <br />
     <table class="form-layout-compressed" id="profile">
     {foreach from=$fields item=field key=fieldName}
         {assign var=n value=$field.name}
@@ -47,6 +52,11 @@
            <td class="label">{$form.$from.label}</td>
                 <td class="description">{$form.$from.html}&nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{$form.$to.html}</td>
         </tr>
+{if $field.help_post}
+ <tr>
+ <td class="description">{$field.help_post}</td>
+ </tr>
+{/if}
    {else}
        <tr>
           <td class="label">{$form.$from.label}</td>
@@ -54,6 +64,12 @@
             &nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{include file="CRM/common/jcalendar.tpl" elementName=$to}</td>
        </tr>
    {/if}    
+{if $field.help_post}
+ <tr>
+ <td class="description">{$field.help_post}</td>
+ </tr>
+{/if}
+
  {elseif $field.options_per_line}
  <tr>
         <td class="option-label">{$form.$n.label}</td>
@@ -85,6 +101,9 @@
           {/if}
           {/foreach}
         </tr>
+ <tr>
+ <td colspan={$field.options_per_line} class="description">{$field.help_post}</td>
+ </tr>
         </table>
         {if $field.html_type eq 'Radio' and $form.formName eq 'Search'}
             &nbsp;&nbsp;(&nbsp;<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}unselect{/ts}</a>&nbsp;)
@@ -125,6 +144,7 @@
     {/foreach}
     <tr><td></td><td>{$form.buttons.html}</td></tr>
     </table>
+  {$field.groupHelpPost}
 </div>
 
 {if $groupId}
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

sergeich

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • USDLC
Re: Adding Help text to search profile
March 15, 2010, 09:05:21 am
Thanks Eileen, that's the part I needed:

{assign var=field value=$fields|@reset}
{$field.groupHelpPre}

I used it in CRM/common/joomla.tpl

Now, when I display a Profile Search restricted to a certain group on Joomla's frontend the page gives me a description for that Profile and Search Results (contacts).

Thank you very much!

ashantycapre

  • Guest
Re: Adding Help text to search profile
July 13, 2010, 06:30:42 pm
Hi,
If this is the source coedCode:

Index: templates/CRM/Profile/Form/Search.tpl
===================================================================
--- templates/CRM/Profile/Form/Search.tpl   (revision 26464)
+++ templates/CRM/Profile/Form/Search.tpl   (working copy)
@@ -36,6 +36,11 @@
         <div>
     {/if}
 
+    {assign var=field value=$fields|@reset}
+    {$field.groupHelpPre}
+ 
+    <br />
+    <br />
     <table class="form-layout-compressed" id="profile">
     {foreach from=$fields item=field key=fieldName}
         {assign var=n value=$field.name}
@@ -47,6 +52,11 @@
                <td class="label">{$form.$from.label}</td>
                 <td class="description">{$form.$from.html}&nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{$form.$to.html}</td>
            </tr>
+{if $field.help_post}
+      <tr>
+      <td class="description">{$field.help_post}</td>
+      </tr>
+{/if}
       {else}
        <tr>
              <td class="label">{$form.$from.label}</td>
@@ -54,6 +64,12 @@
             &nbsp;&nbsp;{$form.$to.label}&nbsp;&nbsp;{include file="CRM/common/jcalendar.tpl" elementName=$to}</td>
        </tr>
       {/if}   
+{if $field.help_post}
+      <tr>
+      <td class="description">{$field.help_post}</td>
+      </tr>
+{/if}
+
    {elseif $field.options_per_line}
    <tr>
         <td class="option-label">{$form.$n.label}</td>
@@ -85,6 +101,9 @@
           {/if}
           {/foreach}
         </tr>
+                     <tr>
+            <td colspan={$field.options_per_line} class="description">{$field.help_post}</td>
+            </tr>
         </table>
         {if $field.html_type eq 'Radio' and $form.formName eq 'Search'}
             &nbsp;&nbsp;(&nbsp;<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}unselect{/ts}</a>&nbsp;)
@@ -125,6 +144,7 @@
     {/foreach}
     <tr><td></td><td>{$form.buttons.html}</td></tr>
     </table>
+  {$field.groupHelpPost}   
 </div>
 
 {if $groupId}

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Adding Help text to search profile

This forum was archived on 2017-11-26.