Forums / Developer / Placing set statements inside a switch statement

"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".

Placing set statements inside a switch statement

Author Message

Trevor Clowry

Tuesday 21 June 2005 5:59:36 am

Hello
I am using a fetch variable, 'testimonials'. The value of testimonials should depend on the node ID of the page being viewed. If the nodeID=74 I want to reset the 'testimonials' variable using a different fetch function. I have attempted to achieve this with the code reproduced below. However, when the page ID is 74, the variable, testimonials does not get reset and it uses the result of the first fetch function,(shuffle). Could anyone help me out on this one?
TC

{let
pageid=$node.node_id
testimonials=fetch('content',list,hash(parent_node_id,81 ))|shuffle
}
{switch name=Sw1 match=$pageid}
{case match=74}
{set
testimonials=fetch('content',list,hash(parent_node_id,81,'limit',1, 'attribute_filter', array( array( 189,'=','hotel' ) ))   )
}
{/case}
{case}
{*default case*}
{/case}
{/switch}
{/let}