I'm trying to create a membership directory, and I don't want to display the "Name" field, which shows the "sort name". How can I accomplish this?


This question was asked 5 years ago on the old CiviCRM forum, here.

Here's a solution updated to work with CiviCRM 4.6.10:

@@ -59,26 +51,30 @@
       <tr class="columnheader">
       {foreach from=$columnHeaders item=header}
-        <th scope="col">
-        {if $header.sort}
-          {assign var='key' value=$header.sort}
-          {$sort->_response.$key.link}
-        {else}
-          {$header.name}
+        {if $header.sort neq 'sort_name' }
+          {if $header.sort}
+          <th scope="col">
+            {assign var='key' value=$header.sort}
+            {$sort->_response.$key.link}
+           </th>
+          {else}
+            {$header.name}
+          {/if}
-         </th>

       {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}
+      {foreach from=$row key=index item=value key=field}
+        {if $field gt 1}
         {if $columnHeaders.$index.field_name}
           <td class="crm-{$columnHeaders.$index.field_name}">{$value}</td>
+        {/if}

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.