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

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)}