Check if attribute is required

Author Message

Silke Fox

Wednesday 30 June 2004 1:54:30 am

Does anyone have an idea how to check in a template if an attribute is required (as defined in the content class)?
This would be useful for information collector forms to mark the mandatory fields.

Thanks for your time.
Silke

Paul Forsyth

Wednesday 30 June 2004 2:15:13 am

Yip, use this code:

{section show=$attribute.contentclass_attribute.is_required|gt(0)}
*
{/section}

which will show an asterisk if the attribute is required.

paul

--
http://www.visionwt.com

Silke Fox

Wednesday 30 June 2004 4:35:59 am

Hey, that's easy...
Thank you, Paul.

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 19 2025 12:50:38
Script start
Timing: Jan 19 2025 12:50:38
Module start 'layout'
Timing: Jan 19 2025 12:50:38
Module start 'content'
Timing: Jan 19 2025 12:50:38
Module end 'content'
Timing: Jan 19 2025 12:50:38
Script end

Main resources:

Total runtime0.8543 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1563152.6250
Module start 'layout' 0.00550.0027 741.781339.4453
Module start 'content' 0.00830.8444 781.2266469.4688
Module end 'content' 0.85260.0016 1,250.69538.1641
Script end 0.8543  1,258.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3954160.0002
Check MTime0.00140.1671160.0001
Mysql Total
Database connection0.00090.104110.0009
Mysqli_queries0.813295.1950570.0143
Looping result0.00050.0572550.0000
Template Total0.826196.720.4130
Template load0.00190.224520.0010
Template processing0.824196.470720.4121
Template load and register function0.00020.025310.0002
states
state_id_array0.00090.103710.0009
state_identifier_array0.00090.106920.0005
Override
Cache load0.00160.1865170.0001
Sytem overhead
Fetch class attribute can translate value0.00160.190620.0008
Fetch class attribute name0.00150.170930.0005
XML
Image XML parsing0.00040.044820.0002
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00070.0808100.0001
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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.0002 secs