Using conditional expressions with stash: variable in stash: embed

I am having problems with Stash when using stash: variables in channel conventions.

template.html

{stash:embed name="pages" stash:paginate="y"} 

pages.html

 {exp:channel:entries channel="page" dynamic="no" limit="{stash:limit}" disable="categories|category_fields|member_data"} <h2>{title}<h2> {if '{stash:paginate}' == 'y'} {!-- pagination code --} {/if} {/exp:channel:entries} 

Setting a limit using {stash:limit} works fine, but I can't show / hide pagination using stash:paginate="y" . It seems that pagination is always displayed regardless of the stash variable.

+4
source share
2 answers

I expect this to be the parse order command, your first var works because it was parsed correctly, and your second var is not parsed before the exp: channel.

Try parse=inward on exp:channel

I am not a wizard with the application, but a similar experience suggests that the parsing order is in the game

+3
source

I used the cache for the first time recently, and I’m used to it. I found that I should use the Parse = "inward" tag and remember that I need to use the value "value" vs 'value' (single quote or double quote). Small things like this made a big difference. Bottom line ... the parse order is one of the most important aspects of EE, but I and many others do not understand enough. This is my homework today: the parser order and all this is a minute.

+3
source

Source: https://habr.com/ru/post/1441845/


All Articles