Ad

Laravel Displaying Information In {% Content %}

- 1 answer

Have problem to display content block information

{% content 'structurated/'this.page.filename %}

This returns an error. If I remove 'structurated/'{% content this.page.filename %} it is working and returning content block. But I need to return information from structurated/ folder. How can I change code that would work ?

{% content 'structurated/'this.page.filename %}

ERROR:
Unexpected token "punctuation" of value "." ("operator" expected with value "=").
==========
{% content 'structurated/'.this.page.filename %}

An exception has been thrown during the rendering of a template ("The content file '' is not found.").
==========
{% content 'structurated/'+this.page.filename %}

An exception has been thrown during the rendering of a template ("The content file '0' is not found.").
Ad

Answer

This should do it.

{% content 'structurated/' ~ this.page.filename %}

It's right now not being concatenated correctly

Ad
source: stackoverflow.com
Ad