Skip to content

Instantly share code, notes, and snippets.

@pelusium
Created September 13, 2013 09:43
Show Gist options
  • Save pelusium/6548597 to your computer and use it in GitHub Desktop.
Save pelusium/6548597 to your computer and use it in GitHub Desktop.
- Filter by class - get children/parent/grandparent
{def $areas_negocio_list = fetch( 'content', 'list',
hash( 'parent_node_id', $areas_negocio_id.node_id, 'class_filter_type', 'include',
'class_filter_array', array( 'folder' ),
'depth', 3 ) )}
{def $dep = 0}
{def $number_children = 0}
{foreach $areas_negocio_list as $area_negocio}
{if ne($area_negocio.children_count,0)}
{set $number_children = 0}
{foreach $area_negocio.children as $children}
{if eq($children.class_identifier,'pagina_base')} <!-- Verifica se dentro da pasta contem algum objecto com classe: Pagina_Base -->
{set $number_children = $number_children|inc}
{if eq($number_children,1)}
{set $dep=$children.depth}
{if eq($dep,4)}
<p>{$children.parent.name}</p>
{/if}
{if eq($dep,5)}
<p> {$children.parent.parent.name} | {$children.parent.name}</p>
{/if}
{/if}
{/if}
{/foreach}
{/if}
{/foreach}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment