I'm using this at the top of my item.php which I got from
community.getk2.org/forum/topics/top-tip-for-templating-k2s
//setup new array
$exFields = array();
//loop thru extrafields and build collection of key and values
foreach ($this->item->extra_fields as $key=>$extraField):
$exFields[$extraField->name] = $extraField->value;
endforeach;
I'm trying to query the name to see if it equals a value and if it does publish a different date, heres the code I'm trying
<?php if $extraField->name =["Closing date"]; ?>
{
<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="catItemExtraFieldsValue"><?php echo $this->item->publish_down, JText::_('K2_DATE_FORMAT_LC2')); ?></span>
}
else
{
<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
}
<?php endif; ?>
Can't get it to work, if someone who knows php could tell me what I'm doing wrong would greatly appreciate it.
community.getk2.org/forum/topics/top-tip-for-templating-k2s
//setup new array
$exFields = array();
//loop thru extrafields and build collection of key and values
foreach ($this->item->extra_fields as $key=>$extraField):
$exFields[$extraField->name] = $extraField->value;
endforeach;
I'm trying to query the name to see if it equals a value and if it does publish a different date, heres the code I'm trying
<?php if $extraField->name =["Closing date"]; ?>
{
<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="catItemExtraFieldsValue"><?php echo $this->item->publish_down, JText::_('K2_DATE_FORMAT_LC2')); ?></span>
}
else
{
<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
<span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
}
<?php endif; ?>
Can't get it to work, if someone who knows php could tell me what I'm doing wrong would greatly appreciate it.