Share » Forums » Setup & design » How can I use values from enumobject...

How can I use values from enumobject in a class_filter_array for fetch?

How can I use values from enumobject in a class_filter_array for fetch?

Monday 05 January 2004 5:34:23 am - 1 reply

Author Message

Wenyue Yu

Wednesday 07 January 2004 1:28:37 am

Hi,

Suppose that you have defined your enum element something like following:
Enum element->Article Enum value->2
Enum element->Image Enum value->5
Enum element->Folder Enum value->1
...
To convert the values from enum object to a array, you can first define a variable in your template, then access the enum object and assign values to the variable, and finally use this variable to filter fetching. Here is a example:
{let myarray=array() enumlist=$node.data_map.your_attribute_identifier.content.enumobject_list}
{section loop=$:enumlist}
{set myarray=$myarray|append($:item.enumvalue)}
{/section}
{let object_list=fetch(content,list,
hash(parent_node_id,
2,
class_filter_type, include,
class_filter_array,$myarray ) )}
{/let}
{/let}

Regards,
wenyue

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

36 542 Users on board!

Forums menu