I appreciate the help I got recently from Rolf on another post where I was attempting to order the custom fields in the CompanyDirectory detail template.
(Please forgive my lack of knowledge about how to encase code in a separate box, and feel free to let me know how its done.)
I put this code at the top of the template:
Code: Select all
{if $customfieldscount gt 0}
{foreach from=$customfields item=customfield}
{capture assign=$customfield->name}{$customfield->value}{/capture}
{/foreach}
{/if}
Code: Select all
{if $Host_Organization ne ''}
<p><strong>Host Organization:</strong> {$Host_Organization}</p>
{/if}
I started by putting the same bit of {foreach}{capture} code at the top of the template and trying several methods of getting the custom fields to show up. Here is a sample of code from the template:
Code: Select all
{$startform}
<div class="row">
<div class="prompt">{$nametext}:</div>
<div class="input">{$inputname}</div>
</div>
<div class="row">
<div class="prompt">Host Organization:</div>
<div class="input">???</div>
</div>
In the default template, the customfields are created using a tag that looks like {$customfield->input_box}, but that simply makes an empty box, and the values aren't filled in during the "Edit Company" mode.
I would like to know how to create and populate that custom field with Smarty. Anyone?
Thanks for reading this.
// Rolf : Added code tags