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:
@@ -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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user