Author Topic

James Packham

Wednesday 14 January 2004 1:55:26 am

Comment14409

Yay! I figured out how to do it. Incase anyone's interested you can add the following section statement to an override of edit_attribute.tpl (the code in the middle is already in edit_attribute). This uses the name of the attribute to filter out the attributes you don't want.

All you have to do then is add the word restricted to the begining of the identifier for the attributes you don't want.

{section show=$ContentObjectAttribute:item.contentclass_attribute_identifier|begins_with("restricted" )|not()}
<label>{$ContentObjectAttribute:item.contentclass_attribute.name|wash}</label><div class="labelbreak"></div>
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />
{attribute_edit_gui attribute_base=$attribute_base attribute=$ContentObjectAttribute:item}

{/section}

Also bear in mind that this code is repeated in a section-else (though I'm not sure why, something to do with a different set of conditions).

Thanks for your help :)

~James~