n-tags showing upin source if block name is a variable (Latte standalone)
- tpr
- Member | 55
Using this code produces n-tags showing up in the html source. See also the inspector screenshot (there are n:foreach and n:if macros in the corresponding code).
{layout 'layouts/@' . $layout .'.latte'}
{var $main_block = $layout == 'default' ? 'content' : 'main'}
{block $main_block}
I believe this worked fine before Latte version 2.4. If I set the block name as a string, there is no such issue.
Do I need to make things differently or is it a bug?
Last edited by tpr (2016-07-04 13:20)
- tpr
- Member | 55
Thanks but no, it's there even without JS (and in the page source). That was the first thing I checked.
Here is another page where I just set the block name to a variable like this:
http://mosolygo.paqartdesign.com/…-1-szazalek/
{var $block_name = 'content'}
{block $block_name}
The issue is also present if I set the variable outside from the latte file (in “presenter” but as I wrote I'm using the standalone version of Latte).
- David Matějka
- Moderator | 6445
It's a bug. I will send a fix.
edit: done https://github.com/…tte/pull/125 :)