Share » Forums » Setup & design » Correct use of the "or" operator?

Correct use of the "or" operator?

Correct use of the "or" operator?

Sunday 16 October 2005 2:33:21 pm - 2 replies

Author Message

Bruce Morrison

Sunday 16 October 2005 5:26:14 pm

Hi Fraser

I think you are after something like:

{*gather attributes for a node object's class and assign to $attributes variable*}
{def $attributes=fetch( 'content', 'class_attribute_list', hash( 'class_id', $class.object.contentclass_id ) )}

{*start the table*}
<table border="1">

{*create the headers row using each attribute name as a column header*}
<th>
<tr>
{foreach $attributes as $attribute}
  {if or(eq( $attribute.identifier, 'organization_name'),eq( $attribute.identifier ,'org_type'))}
<td>
{$attribute.name|wash}
</td>
  {/if}
{/foreach}
</tr>
</th>

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Fraser Hore

Monday 17 October 2005 10:30:02 am

Brilliant! Thanks Bruce it worked!

The examples in the documentation for the "or" operator really threw me off. I couldn't figure out what was being compared and assumed it was the first parameter. Your code makes a lot more sense.

Cheers,

Fraser

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

36 542 Users on board!

Forums menu