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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Adding fields to custom profile views
Pages: [1]

Author Topic: Adding fields to custom profile views  (Read 291 times)

roblog

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 5.42
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Adding fields to custom profile views
February 13, 2015, 07:54:15 am
Hi. Our site has a custom profile view, with a bit of legacy code that no longer works. The code is intended to add a field to the View, as per the following  instructions:

{* If you want a custom profile view, you can access field labels and values in $profileFields_N array - where N is profile ID. *}
{* EXAMPLES *}{* $profileFields_1.last_name.label *}{* $profileFields_1.last_name.value *}

Here is the code itself:

Code: [Select]
   
   {foreach from=$profileGroups item=group}
        <h2>{$group.title}</h2>
        <div id="image"><img src="{$profileFields_25.custom_160.value}"></div>

        <div id="profilewrap{$groupID}">
                 {$group.content}
        </div>
    {/foreach}

I'm using version 4.5.2. Is it still possible to use the $profileFields_N array in this version? If not, is there any documentation on how else to go about this?

Thanks

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Adding fields to custom profile views
February 13, 2015, 08:24:24 am
Hi roblog,

A good way to find what you're looking for is to enable debugging (found at Administer menu > System Settings > Debugging and Error Handling), then reload the View page, but append "&smartyDebug=1" onto the end of the URL.  You should see a list of all Smarty variables.  I just tried it myself, and assuming you're looking at the same page I am (the single record view, not the listings), it seems like it should be $profileFields, not $profileFields_25?
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Adding fields to custom profile views

This forum was archived on 2017-11-26.