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) »
  • Members Directory profile--how to get rid of "Name"?
Pages: [1]

Author Topic: Members Directory profile--how to get rid of "Name"?  (Read 3994 times)

canadave

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Joomla
  • MySQL version: 5
  • PHP version: 5
Members Directory profile--how to get rid of "Name"?
April 04, 2011, 08:12:04 am
Hi all,

Just starting out with Civi.  I set up a basic profile for a searchable Membership Directory for our small club.  In the profile, called "Members Directory", I just put Last Name, First Name, and Phone as searchable fields.

If I leave those fields blank, and run the search, it returns all my members as expected.  However, it also includes a field, "Name", as the very first column.  So for instance, it has this type of record:

Code: [Select]
Name                           Last Name           First Name        Phone
Smith, Joe                    Smith                Joe                 xxx-xxxx

How can I set up this membership directory profile so that it doesn't include that "Name" field at the beginning?

Also...I notice that the VERY first column (even before Name) has little icons showing what type of contact it is (Individual, Household, or Organization).  If I hover my mouse over an icon, a big long horizontal black bar appears that's intended to contain some sort of explanatory text I suppose...except it's completely blank.  What is that, and is there any way to disable it?
« Last Edit: April 04, 2011, 08:15:19 am by canadave »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Members Directory profile--how to get rid of "Name"?
April 05, 2011, 04:50:18 pm
Quote
How can I set up this membership directory profile so that it doesn't include that "Name" field at the beginning?
Currently you cannot remove it without custom template or modifying the template. Below patch should hide the name.

Quote
Index: templates/CRM/Profile/Page/Listings.tpl
===================================================================
--- templates/CRM/Profile/Page/Listings.tpl   (revision 33547)
+++ templates/CRM/Profile/Page/Listings.tpl   (working copy)
@@ -50,11 +50,12 @@
     {include file="CRM/common/pager.tpl" location="top"}
     {* Search criteria are passed to tpl in the $qill array *}
     
-
+{debug}
     {strip}
     <table>
       <tr class="columnheader">
       {foreach from=$columnHeaders item=header}
+        {if $header.sort neq 'sort_name' }
         <th scope="col">
         {if $header.sort}
           {assign var='key' value=$header.sort}
@@ -63,14 +64,17 @@
           {$header.name}
         {/if}
          </th>
+         {/if}
       {/foreach}
       </tr>
     
       {counter start=0 skip=1 print=false}
       {foreach from=$rows item=row name=listings}
       <tr id="row-{$smarty.foreach.listings.iteration}" class="{cycle values="odd-row,even-row"}">
-      {foreach from=$row item=value}
+      {foreach from=$row item=value key=field}
+        {if !$field or $field neq 'sort_name'}
         <td>{$value}</td>
+        {/if}
       {/foreach}


Quote
If I hover my mouse over an icon, a big long horizontal black bar appears that's intended to contain some sort of explanatory text I suppose...except it's completely blank.  What is that, and is there any way to disable it?

On hovering the contact type icon it should show preview about contact, using contact summary profile. It should not be empty.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Dwiding

  • I post frequently
  • ***
  • Posts: 165
  • Karma: 8
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.x
Re: Members Directory profile--how to get rid of "Name"?
April 14, 2011, 07:40:07 am
We recently upgraded to the most recent release of the 3.4 beta (released on the 6th or 9th) on joomla 1.5

When we hoover over the the contact type icon, we no longer get the summary overview, we get a Edit Search Criteria box pop up, image attached.

This happens with the Front End Listings. On the back end, the Summary Overlay pop up works just fine.
« Last Edit: April 14, 2011, 12:44:29 pm by Dwiding »

Dwiding

  • I post frequently
  • ***
  • Posts: 165
  • Karma: 8
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.x
Re: Members Directory profile--how to get rid of "Name"?
April 14, 2011, 12:58:47 pm
It gets worse.

Now when we click on "View" for any contact in the listing, we no longer get the selected profile view of the selected record, but get the same Search Criteria box, using the profile that is used to publish the listings.

No sure how to make public listings on the sandbox site using drupal, so I do not know how to test this on the sandbox.

D

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Members Directory profile--how to get rid of "Name"?
April 14, 2011, 02:20:42 pm
Thanks for reporting this. I recreated same on our j1.6 sandbox and have opened an issue:
http://issues.civicrm.org/jira/browse/CRM-7916
Protect your investment in CiviCRM by  becoming a Member!

thommo

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 0
  • CiviCRM version: 4.0 stable
  • CMS version: Joomla 1.6.3
  • MySQL version: 5.0.92
  • PHP version: 5.2.11
Re: Members Directory profile--how to get rid of "Name"?
April 22, 2011, 05:00:11 pm
In terms of usability, I don't think the hover over the contact icon is helpful. I would like to make it very simple for a user to work out what they need to do next.
First they search, then they see the result, then they click on View.

This is of course, just my view.

Kurund, thank you for your patch for removing the Name column.
Could you, or someone else, please tell me how to remove the icon and column please?

thank you


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Members Directory profile--how to get rid of "Name"?
April 22, 2011, 05:24:29 pm
Michael - If you are using the profile on public facing pages, and you verify that the Summary Overlay profile fields visibility is set to User and User Admin, then the hover-over won't appear. However, if you still need to get rid of the contact icon column, you can modify the Listings.tpl file as follows (note the change to add a 'name=' property to both foreach loops, and then using the .iteration value to skip the first item in the column header and row values loops).

Code: [Select]
    <table>
      <tr class="columnheader">
      {foreach from=$columnHeaders item=header name=headers}
        {if $smarty.foreach.headers.iteration GT 1}
        <th scope="col">
        {if $header.sort}
          {assign var='key' value=$header.sort}
          {$sort->_response.$key.link}
        {else}
          {$header.name}
        {/if}
         </th>
        {/if}
      {/foreach}
      </tr>
   
      {counter start=0 skip=1 print=false}
      {foreach from=$rows item=row name=listings}
      <tr id="row-{$smarty.foreach.listings.iteration}" class="{cycle values="odd-row,even-row"}">
      {foreach from=$row item=value name=cells}
        {if $smarty.foreach.cells.iteration GT 1}
        <td>{$value}</td>
        {/if}
      {/foreach}
      </tr>
      {/foreach}
    </table>
Protect your investment in CiviCRM by  becoming a Member!

thommo

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 0
  • CiviCRM version: 4.0 stable
  • CMS version: Joomla 1.6.3
  • MySQL version: 5.0.92
  • PHP version: 5.2.11
Re: Members Directory profile--how to get rid of "Name"?
April 22, 2011, 06:42:08 pm
Hi Dave
I can't remove the column.
I went back to original code in the listings.tmp and replaced the table with your suggestion.
I think it just shifted the headers to the left?
and the name column is back because I deleted the patch by Kurund.
So starting with the original code, to remove both the icon and the name column, what would the code be?
thank you very much

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Members Directory profile--how to get rid of "Name"?
April 25, 2011, 10:28:13 am
The code above does work for me - make sure you scroll in the code box and handle both the header row and the values rows. If you want to eliminate first TWO columns, then use "GT 2" instead of "GT 1" in both spots. If this is not making sense to you I would suggest spending a bit of time studying the Smarty documentation since it's best that you understand what you're doing if you're making template code changes :-)

http://www.smarty.net/docsv2/en/
Protect your investment in CiviCRM by  becoming a Member!

thommo

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 0
  • CiviCRM version: 4.0 stable
  • CMS version: Joomla 1.6.3
  • MySQL version: 5.0.92
  • PHP version: 5.2.11
Re: Members Directory profile--how to get rid of "Name"?
April 25, 2011, 02:52:29 pm
Dave,
apologies, I didn't read your message properly.
It works exactly as you said.
thank you very much
Michael

Franck-AWO

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
    • l'AtelierWeb.Org
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 7.23
  • MySQL version: 5.1.66
  • PHP version: 5.3.5
Re: Members Directory profile--how to get rid of "Name"?
May 22, 2013, 12:20:57 am
Quote from: Dave Greenberg on April 22, 2011, 05:24:29 pm
Michael - If you are using the profile on public facing pages, and you verify that the Summary Overlay profile fields visibility is set to User and User Admin, then the hover-over won't appear. However, if you still need to get rid of the contact icon column, you can modify the Listings.tpl file as follows (note the change to add a 'name=' property to both foreach loops, and then using the .iteration value to skip the first item in the column header and row values loops).

Code: [Select]
    <table>
      <tr class="columnheader">
      {foreach from=$columnHeaders item=header name=headers}
        {if $smarty.foreach.headers.iteration GT 1}
        <th scope="col">
        {if $header.sort}
          {assign var='key' value=$header.sort}
          {$sort->_response.$key.link}
        {else}
          {$header.name}
        {/if}
         </th>
        {/if}
      {/foreach}
      </tr>
   
      {counter start=0 skip=1 print=false}
      {foreach from=$rows item=row name=listings}
      <tr id="row-{$smarty.foreach.listings.iteration}" class="{cycle values="odd-row,even-row"}">
      {foreach from=$row item=value name=cells}
        {if $smarty.foreach.cells.iteration GT 1}
        <td>{$value}</td>
        {/if}
      {/foreach}
      </tr>
      {/foreach}
    </table>

Hi,
This is just a feed back (using Joomla 2.5.9 and CiviCRM 4.2.9) :
I have verified that the Summary Overlay profile fields visibility is set to User and User Admin, but the hover-over still appears.
May be that comes since I made the profile listing visible on a public web page (following this doc : http://wiki.civicrm.org/confluence/display/CRMDOC42/Configuring+Front-end+Profile+Listings+and+Forms+in+Joomla!+Sites) ?
Anyway, this code above is still working :)
Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Members Directory profile--how to get rid of "Name"?

This forum was archived on 2017-11-26.