This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » How to add a graphic showing required...

How to add a graphic showing required fields on the entry screens?

How to add a graphic showing required fields on the entry screens?

Thursday 03 April 2003 1:15:59 pm - 1 reply

I am trying to include a graphic (just a * character) to illustrate the fields that are required. How do I do this?

I have created a case statement but need to know the object to access. For example:

{switch match=$ClassAttribute:item.classAttribute_IsRequired}
{case match=0} {/case}
{case match=1}*{/case}
Matched default

What is the correct object to access?

Modified on Tuesday 08 April 2003 12:55:26 pm by Stuart Fenton

Friday 11 April 2003 4:26:27 pm

Do you mean in the content edit fields?

How you access the attributes depends on whether you want a general implementations (ie. looping the attributes) or specific (using attribute names).

The first is simply to look at the code in design/standard/templates/content/edit_attribute.tpl, create an override by placing it in design/mydesign/override/templates/content/. For example:

{section name=ContentObjectAttribute loop=$content_attributes sequence=array(bglight,bgdark)}
<div class="block">
<label>{$}{section show=$ContentObjectAttribute:item.contentclass_attribute.is_required}*{/section}</label><div class="labelbreak"></div>
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$}" />
{attribute_edit_gui attribute=$ContentObjectAttribute:item}

The code that matches is:
{section show=$ContentObjectAttribute:item.contentclass_attribute.is_required}*{/section}

The second way is to access the attribute trough the data_map array, for instance to get the attribute named name.
{section show=$}*{/section}


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

36 542 Users on board!

Forums menu

Proudly Developed with from