You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to templating and there's something that is throwing me.
Previous, I set page specific data in a view (home.php,about.php,etc). Each page would include a partial like "head.php". When "head.php" was included, it would have access to said data.
Using Mustache, there doesn't seem to be to define page-specific variables without having to define a route for each individual page/view/whatever.
Am I missing something?
Thanks.
EDIT:
The solution I've come up with is to store page-specific data as custom attributes on elements, then to grab them with DomDomdocument, then work that into Mustache.
The text was updated successfully, but these errors were encountered:
You can define a layout in mustache and add blocks there, in your specific template then you can define what ever you like.
Example:
lets say you create a mainLayout.mustache with following Code https://pastebin.com/f5kFVkcn
Then you have lets say on the main page different header image than on contact.
So you can define Layouts and define placeholders in the layout, e.g. content, title, stylesheets etc. Then in your template you define which layout should be used and inside the template you define the content for the placeholders.
Hello @bobthecow
I'm new to templating and there's something that is throwing me.
Previous, I set page specific data in a view (home.php,about.php,etc). Each page would include a partial like "head.php". When "head.php" was included, it would have access to said data.
Using Mustache, there doesn't seem to be to define page-specific variables without having to define a route for each individual page/view/whatever.
Am I missing something?
Thanks.
EDIT:
The solution I've come up with is to store page-specific data as custom attributes on elements, then to grab them with DomDomdocument, then work that into Mustache.
The text was updated successfully, but these errors were encountered: