Forums / Setup & design / Problem with logical operator "contains"

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Problem with logical operator "contains"

Author Message

Tore Skobba

Thursday 06 November 2003 3:23:28 am

Solved it myself! See bottom for my solution.
Hi

I am making an tree menu where folders should be displayed differently from articles. In order to do this I fetch all child objects, and then try to decide what type the object is of. The code snippet is below here:
{section show=(1,19,25)|contains($:item.object.contentclass_id)}

Where (1,19,25) are my variuos folder content classes. However this does not work, the above is always true also for item that have a different contentclass_id than (1,19,25).. So I guess I might use the contains logics operator wrongly. Anyone who can see any errors?

See below for more code snippets:

{section loop=fetch(content,list,hash(parent_node_id,$node_obj.node_id))}
{section show=(1,19,25)|contains($:item.object.contentclass_id)}
FOLDER TYPE
{section-else}
NONE FOLDER TPE
{/section}

Cheers
Tore

SOLUTION

{section show=(1,19,25)|contains($:item.object.contentclass_id)}
is alway true. However, inserting "array" after "=" makes it work.

{section show=array(1,19,25)|contains($:item.object.contentclass_id)}