Displaying content if there is content?

Author Message

arthur foelsche

Friday 02 May 2003 11:01:44 am

Sorry for yet another newbie question. I have a custom class which sometimes has data in it. I want to display it, along with other html when there is data in it. I tried the following:

{section show=$content_version.datamap.article_fan_notes}
<b>text</b>: {attribute_view_gui attribute=$content_version.data_map.article_fan_notes}<hr noshade size=0>{/section}

i tried using the eq operator as well, but this didn't seem to work either. What is the syntax the show command to display if there is data?

Thanks!

arthur

Marco Zinn

Friday 02 May 2003 2:46:45 pm

Good question. And far from "newbie" level.

I don't know. I would have gone for "eq", too...on attribute-level, not on object level.
You _are_ speaking about "hiding an attribute", when it is empty, right?

Marco
http://www.hyperroad-design.com

arthur foelsche

Sunday 04 May 2003 5:17:38 am

Yes, that is exactly what i'm talking about. I accedently posted this to the install forum and it was suggested that i use the count() function to see if the count of the string is greater than 0. Unfortunately, it seems to count the variable, and not its attribute. Judging from your post, it seems like i'm comparing the attribute value itself... how do i do that?

thanks for the help!

arthur

Vivienne van Velzen

Sunday 04 May 2003 11:49:53 am

Arthur,

You might want to try this:

{section show=$content_version.datamap.article_fan_notes.content}

Then it'll check on the actual content of the variable.\
Greetz,

Vivienne

arthur foelsche

Sunday 04 May 2003 7:03:23 pm

Here's what i put together based on the above comments:

{section show=ne($content_version.datamap.article_fan_notes.content,"")}
html goes here....
{/section}

checking for 0 didn't work, but "" seems to be returned when there is no content.

Thanks for everybody's help!

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 04:13:56
Script start
Timing: Jan 18 2025 04:13:56
Module start 'layout'
Timing: Jan 18 2025 04:13:56
Module start 'content'
Timing: Jan 18 2025 04:13:57
Module end 'content'
Timing: Jan 18 2025 04:13:57
Script end

Main resources:

Total runtime0.7135 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.1484152.6406
Module start 'layout' 0.00720.0034 741.789139.4766
Module start 'content' 0.01060.7012 781.2656591.1094
Module end 'content' 0.71180.0017 1,372.375012.1250
Script end 0.7135  1,384.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4534160.0002
Check MTime0.00140.2015160.0001
Mysql Total
Database connection0.00150.203810.0015
Mysqli_queries0.653691.6046650.0101
Looping result0.00060.0796630.0000
Template Total0.677895.020.3389
Template load0.00220.308920.0011
Template processing0.675694.686320.3378
Template load and register function0.00020.031510.0002
states
state_id_array0.00190.270110.0019
state_identifier_array0.00090.131720.0005
Override
Cache load0.00170.2363320.0001
Sytem overhead
Fetch class attribute can translate value0.00070.100630.0002
Fetch class attribute name0.00150.210960.0003
XML
Image XML parsing0.00120.168330.0004
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00080.1117160.0000
String conversion0.00000.001140.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs