Share » Forums » Suggestions » Select frontpage image

Select frontpage image

Select frontpage image

Wednesday 10 September 2003 5:23:33 am - 1 reply

Author Message

Daniel Staver

Friday 19 September 2003 1:46:21 am

I've solved it for now by creating an override for the integer edit field for class 2 in admin, like this:

[frontpageimage]
Source=content/datatype/edit/ezinteger.tpl
MatchFile=frontpageimageselect.tpl
Subdir=templates
Match[class]=2

And then I put this in the template:

{let name=CurrentObject current_object=fetch('content','version',hash(object_id,$attribute.contentobject_id,version_id,$attribute.version))}
<select name="ContentObjectAttribute_data_integer_{$attribute.id}" size="1">
{section show=$attribute.data_int}
<option value="">Ikke bruk forsidebilde</option>
{section-else}
<option value="" selected>Ikke bruk forsidebilde</option>
{/section}

{section name=ContentObjectRelation loop=$CurrentObject:current_object.related_contentobject_array}
{section show=eq($attribute.data_int,$CurrentObject:ContentObjectRelation:item.id)}
<option value="{$CurrentObject:ContentObjectRelation:item.id}" selected>{$CurrentObject:ContentObjectRelation:item.id} - {$CurrentObject:ContentObjectRelation:item.name}</option>
{section-else}
<option value="{$CurrentObject:ContentObjectRelation:item.id}">{$CurrentObject:ContentObjectRelation:item.id} - {$CurrentObject:ContentObjectRelation:item.name}</option>
{/section}
{/section}
</select>
{/let}

Daniel Staver
http://daniel.staver.no

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu