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) »
  • smarty template and street_address-Primary variable
Pages: [1]

Author Topic: smarty template and street_address-Primary variable  (Read 1371 times)

andrewbelcher

  • Guest
smarty template and street_address-Primary variable
June 24, 2009, 03:15:25 am
Hi,

I'm having a few issues with create a custom template.

I'm trying to have complete control over the profile, so I was attempting to go through and create the form by calling the $fields.field_name and $form.field_name variables. It was working fine until I came to the 'street_address-Primary' field... If I look in the smarty debug they are there, but if I try to call them directly using {$form.street_address-Primary.html} or other variables, it just returns 0. The only thing I can see that is different is the hyphen in the field name. Is there a way around that? I'm new to smarty, so I don't know it all that well...

Thanks,
Andrew

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: smarty template and street_address-Primary variable
June 24, 2009, 11:20:55 am
Hmm - might help to include your code. However, I just did a quick experiment in CRM/Profile/Form/Dynamic.tpl as follows:

Code: [Select]
    {foreach from=$fields item=field key=fieldName}
// added the next 3 lines
        {if $fieldName EQ 'street_address-Primary'}
            <p>hello {$fieldName} : "{$form.$fieldName.html}"</p>
        {/if}   

... and the output on top of my profile form is:

hello street_address-Primary : "[                            ]"
Protect your investment in CiviCRM by  becoming a Member!

andrewbelcher

  • Guest
Re: smarty template and street_address-Primary variable
June 25, 2009, 05:49:56 am
Perfect, that worked!

Thanks for the help!

Andrew

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • smarty template and street_address-Primary variable

This forum was archived on 2017-11-26.