eZ Community » Forums » Setup & design » Displaying content if there is content?
expandshrink

Displaying content if there is content?

Displaying content if there is content?

Friday 02 May 2003 8:01:44 pm - 4 replies

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

Friday 02 May 2003 11: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?

Sunday 04 May 2003 2:17:38 pm

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

Sunday 04 May 2003 8:49:53 pm

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

Monday 05 May 2003 4:03:23 am

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

{section show=ne($content_version.datamap.article_fan_notes.content,""blunk.gif Emoticon}
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!

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from