dexus Posted November 28, 2007 Share Posted November 28, 2007 I know that custom fields are added like this in template files: {foreach key=num item=customfield from=$customfields} <tr><td class="fieldarea">{$customfield.name}</td><td>{$customfield.input} {$customfield.required}</td></tr> {/foreach} but how can I add just one specific field, for example I need just custom field with id=3 somwhere in template file. 0 Quote Link to comment Share on other sites More sharing options...
dexus Posted November 30, 2007 Author Share Posted November 30, 2007 Is it possible that nobody knows how to add one custom field somwhere at the order template file. I just don't wan't all custom fields at one place. 0 Quote Link to comment Share on other sites More sharing options...
dexus Posted November 30, 2007 Author Share Posted November 30, 2007 I just realised how... I never used smarty before, but I should just use my brain If someone like to know you can get the specific custom field like this: <tr><td class="fieldarea">{$customfields[1].name}</td><td>{$customfields[1].input} {$customfields[1].required}</td></tr> 0 Quote Link to comment Share on other sites More sharing options...
gemhosting Posted January 11, 2008 Share Posted January 11, 2008 Thanks for this help! I couldn't find it anywhere... I now have my custom fields outputting on the product details page. Is it possible to access custom fields on the client product listing page within the template clientareaproducts.tpl? 0 Quote Link to comment Share on other sites More sharing options...
Zorro67 Posted April 2, 2008 Share Posted April 2, 2008 I just realised how... I never used smarty before, but I should just use my brain If someone like to know you can get the specific custom field like this: <tr><td class="fieldarea">{$customfields[1].name}</td><td>{$customfields[1].input} {$customfields[1].required}</td></tr> Hi all, have implemented this in a number of templates, and works great, especially for "new registration" type pages. However, for "modify registration" or similar pages, any existing values are not populated. I believe this function was being performed by the first line of the following {if $customfields}<tr><td class="fieldarea"></td></tr>{/if} {foreach key=num item=customfield from=$customfields} <tr><td class="fieldarea">{$customfield.name}</td><td>{$customfield.input} {$customfield.required}</td></tr> {/foreach} however, I now have my custom fields field presenting individually <tr><td class="fieldarea">{$customfields[5].name}</td><td>{$customfields[5].input} {$customfields[5].required} </td></tr><!--Business Size--> I believe that I need to insert the code (or similar) {$customfields.1.value}, but can't find the correct syntax anywhere. Obviously if the field is blank, the value would be empty, but where there is a value, i would like to be able to have that field populated. I have approximately 10 custom field in play, with another 30 or 40 to come. PS, i get the concept of default values in regular fields (value="{$fieldname}) (sic), but duplicating this for custom fields isn't obvious. can anyone help? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.