Add test for priorities while looping and split the new_breadcrumbs function into two separate new_breadcrumbs functions because sections and partials have different orderings.

This commit is contained in:
Tom Alexander
2020-05-25 22:50:10 -04:00
parent 108cffb771
commit 79f52ecdee
3 changed files with 107 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ Partials: Explicit context takes priority over parameters
Sections: New context takes priority, then parameters, then explicit
Sections with loops: Loop variables ($idx and $len) take priority over parameters and explicit context
$idx and $len
-------------

View File

@@ -326,3 +326,34 @@ Section vs Partial priority{~n}
{pet}{~n}
{/some_global}
{>priority:explicit pet="snake"/}
Section vs Partial priority Failed Walk{~n}
======================================={~n}
{#doesnotexist:explicit pet="snake"}
MAIN {pet}{~n}
{:else}
ELSE {pet}{~n}
{/doesnotexist}
{>priority:explicit pet="snake"/}
Section Loop set $idx as a parameter{~n}
===================================={~n}
{#loop $idx="7"}
$idx is {$idx}{~n}
$len is {$len}{~n}
{/loop}
Section Loop set $idx in explicit context{~n}
========================================={~n}
{#loop:has_idx}
$idx is {$idx}{~n}
$len is {$len}{~n}
{/loop}
Section Loop set $idx in explicit context and parameter{~n}
======================================================={~n}
{#loop:has_idx $idx="7"}
$idx is {$idx}{~n}
$len is {$len}{~n}
{/loop}