Show something if attribute is non-emtpy

Author Message

Felix Laate

Thursday 09 October 2003 1:12:31 am

Hi all!

I want some text to show only if the body attribute of the article is empty..

I've tried this:

{section show=ne($content_version.data_map.body.content,'')}
<div class="tekst">- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </div>
{/section}

It gives me the text even if the body is empty ;-(

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Paul Forsyth

Thursday 09 October 2003 1:28:52 am

Xml fields are usually never empty because of xml tags. But there is a specific test you can use for emptiness. See this thread:

http://ez.no/developer/ez_publish_3/forum/developer/how_to_test_an_xml_text_field_is_empty

paul

Felix Laate

Thursday 09 October 2003 1:43:48 am

Hi!

Thanx alot!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Thomas Schamm

Thursday 09 October 2003 4:22:04 am

This is good to no, as it is not documented in the docs or contributions.
Thanks for this link :-)
Greetz, Thomas

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 01:03:15
Script start
Timing: Jan 19 2025 01:03:15
Module start 'layout'
Timing: Jan 19 2025 01:03:15
Module start 'content'
Timing: Jan 19 2025 01:03:15
Module end 'content'
Timing: Jan 19 2025 01:03:15
Script end

Main resources:

Total runtime0.7176 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.2891152.6406
Module start 'layout' 0.00600.0024 741.929739.4766
Module start 'content' 0.00830.7074 781.4063572.0469
Module end 'content' 0.71570.0018 1,353.453112.1250
Script end 0.7175  1,365.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4646160.0002
Check MTime0.00140.1979160.0001
Mysql Total
Database connection0.00100.136610.0010
Mysqli_queries0.648190.3237620.0105
Looping result0.00060.0906600.0000
Template Total0.689396.120.3446
Template load0.01662.306820.0083
Template processing0.672793.749320.3364
Template load and register function0.00010.013510.0001
states
state_id_array0.00090.122110.0009
state_identifier_array0.00100.143720.0005
Override
Cache load0.01572.1927250.0006
Sytem overhead
Fetch class attribute can translate value0.00100.132730.0003
Fetch class attribute name0.00140.194150.0003
XML
Image XML parsing0.00090.129330.0003
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00100.1332160.0001
String conversion0.00000.001640.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs