Welcome Guest, Not a member yet? Register   Sign In
Nested arrays in parser with conditional rendering
#1

Hi,

I´d like to apply a conditional rendering in a nested iterator:
Code:
{parent}
  {children}
    {if $child->someAttribute == "1"}
      HELLO!
    {endif}
  {children}
{/parent}

I tried to use a static index and it works, but would be necessary to know the current iterator index
Code:
{parent}
  {children}
    {if $parent[0]->children[0]->someAttribute == "1"}
      HELLO!
    {endif}
  {children}
{/parent}
If there was something like:
Code:
{if $parent[$parent_idx]->children[$children_idx]->someAttribute == "1"}

Is this possible? There is any workaround?
Thanks in advance!
Reply


Messages In This Thread
Nested arrays in parser with conditional rendering - by artursampaio - 04-02-2025, 01:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB