Forums / Setup & design / Displaying content if there is content?

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!