[SOLVED] Products Module - Displaying a checkbox field
Posted: Mon Apr 22, 2013 10:37 pm
Hello, I have created several Checkbox options inside the Products Module additional Fields tab. I am using the latest 1.11.6 CMSMS
I am trying to check which of the Checkboxes is checked and then display its value (The Name). Here is the code on my summary template:
I am not an expert on Smarty but I have tried to modify this line of code but doesn't work.
I looked at the Smarty if statement functions http://www.smarty.net/docsv2/en/language.function.if but can't seem to figure out how to implement this. Can anyone help me or point me in the right direction?
Thank you
I am trying to check which of the Checkboxes is checked and then display its value (The Name). Here is the code on my summary template:
Code: Select all
<div id="title">
{if count($entry->fields)}
{foreach from=$entry->fields key='name' item='field'}
{if $field->type == 'checkbox' && isset($field->value)}
<p style="font-size:10px; color:#ff0000; margin:0px; padding:0px;">{$field->name}</p>
{/if}
{/foreach}
{/if}
</div>Code: Select all
{if $field->type == 'checkbox' && isset($field->value == true)}Code: Select all
{if $field->type == 'checkbox' && $name == 'Checkbox'}Code: Select all
{if $field->type == 'checkbox'}Thank you