-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.html
22 lines (18 loc) · 1 KB
/
header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!-- Site app page list -->
{$pages = $wa->site->pages()}
{if count($pages)}
<ul class="pages">
{* get selected node (a little magic here): for Site app, due to it's page-only functionality, page heirarchy and ambiguous select highlighe conditions for root app URL we get selected node in 2 foreach's, while for other apps single foreach for pages is ok due to their own content for homepage *}
{$selected_node = null}
{foreach $pages as $p}
{if $wa->currentUrl()|strstr:$p.url && strlen($p.url) >= strlen($selected_node.url)}{$selected_node = $p}{/if}
{/foreach}
{if !$selected_node}{$selected_node.id = null}{/if}
{* render *}
{foreach $pages as $p}
{if $p.url != $wa_url} {* exclude root page link to avoid duplicate link which is on the logo/title *}
<li{if $p.id == $selected_node.id} class="selected"{/if}><a href="{$p.url}">{$p.name}</a></li>
{/if}
{/foreach}
</ul>
{/if}