2

We're using a Profile to create a members directory that is only accessible when members are logged in. The profile search is working fine, and we've restricted access so users only see what we want them to see.

However, in the search results listing, the leftmost column contains a little person icon, and when you hover over it, it shows that person's contact details.

If I'm logged in as an Administrator, I see everything, but if I'm logged in as a user I see nothing except when hovering over my own entry.

I should specify that we're not using a shortcode in a WordPress page, we're linking to the "Listing Mode" of the profile directly.

Is there a way to disable this icon so that it doesn't appear in the listing results?

We're running CiviCRM 4.7.6 on WordPress 4.4.2.

3

Yes, there are at least two ways to disable this icon that I can think of.

The first is not very authentic, but requires less work and code modification. You use CSS to avoid the display of the icon. You'd need to include in your CSS file something like:

.crm-profile-name-<your-profile-name> .Individual-icon {
display: none;  }

Also, you'd need to repeat the CSS selector to Organization-icon and others types of contacts if that's your case. Mind that one can make the icon show up in the browser changing the CSS on the fly and so, would access the overlay information if it is still there. So, this method is not good to secure the data, you should first be sure that data is correctly protected, not showing up publicly in the overlay box.

The second method is much more gentile, but requires you to change the Listing template code. It's referenced by Dave Greenberg in this thread and the code stills work nice, I just tested it.

If you have never customized templates, I would say you should first read this page, as I'd be too long to explain every step to do this here.

Once you are good to go, copy the file civicrm/templates/CRM/Profile/Page/Listings.tpl to your custom templates directory, keeping the folders structure. Edit the file from line 59 to look like this:

    <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 key=index item=value name=cells}
        {if $smarty.foreach.cells.iteration GT 1}
        {if $columnHeaders.$index.field_name}
          <td class="crm-{$columnHeaders.$index.field_name}">{$value}</td>
        {else}
          <td>{$value}</td>
        {/if}
        {/if}

      {/foreach}
      </tr>
      {/foreach}
    </table>
    {/strip}
    {include file="CRM/common/pager.tpl" location="bottom"}
    </div>
{elseif ! $isReset}
    {include file="CRM/Contact/Form/Search/EmptyResults.tpl" context="Profile"}
{/if}

This would make the column of profile overlay icon to go away.

Also, in an that old Forum thread there were a word from Dave Greenberg saying that setting all Summary Overlay profile fields visibility to 'User and User Admin' would disable the overlay, but in the actual CiviCRM version, this profile is reserved, so you can't change the visibility of the field. Hence, the above methods looks necessary to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.