Can I access my own key-value pairs in layout files? #1016
-
I made adjustments in the Can I create another key-value pair in the header area of the In short:
|
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
Hello Hendrik. The API for developers gives you access to the file system and settings. Yes, it's possible to store arbitrary key-value pairs in the page settings and access them with Here's an example layout file
You can customise blog layout files in a similar way. See also #713, #849, #1011. Hope this helps and happy coding. |
Beta Was this translation helpful? Give feedback.
Hello Hendrik. The API for developers gives you access to the file system and settings. Yes, it's possible to store arbitrary key-value pairs in the page settings and access them with
page->get()
,page->getHtml()
and more methods. We are using the same API everywhere from extensions to layout files. This is one of the core features, quite powerful and worth learning sooner or later.Here's an example layout file
system/layouts/default.html
: