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

Author Message

Stuart Fenton

Thursday 03 April 2003 3:15:59 am

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}
{case}
Matched default
{/case}
{/switch}

What is the correct object to access?

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Jan Borsodi

Friday 11 April 2003 7:26:27 am

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>{$ContentObjectAttribute:item.contentclass_attribute.name}{section show=$ContentObjectAttribute:item.contentclass_attribute.is_required}*{/section}</label><div class="labelbreak"></div>
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />
{attribute_edit_gui attribute=$ContentObjectAttribute:item}
</div>
{/section}

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=$object.data_map.name.contentclass_attribute.is_required}*{/section}

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:26:15
Script start
Timing: Jan 18 2025 10:26:15
Module start 'layout'
Timing: Jan 18 2025 10:26:15
Module start 'content'
Timing: Jan 18 2025 10:26:16
Module end 'content'
Timing: Jan 18 2025 10:26:16
Script end

Main resources:

Total runtime0.7903 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.1719152.6563
Module start 'layout' 0.00620.0029 740.828139.5234
Module start 'content' 0.00920.7796 780.3516534.1250
Module end 'content' 0.78880.0015 1,314.476612.0938
Script end 0.7902  1,326.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3905160.0002
Check MTime0.00130.1598160.0001
Mysql Total
Database connection0.00090.112610.0009
Mysqli_queries0.733592.8169540.0136
Looping result0.00050.0639520.0000
Template Total0.749394.820.3747
Template load0.00180.222920.0009
Template processing0.747594.595020.3738
Template load and register function0.00010.018310.0001
states
state_id_array0.00130.169910.0013
state_identifier_array0.00170.210220.0008
Override
Cache load0.00150.1916310.0000
Sytem overhead
Fetch class attribute can translate value0.00070.086020.0003
Fetch class attribute name0.00150.195140.0004
XML
Image XML parsing0.00260.323720.0013
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00240.3067230.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs