Skip to content

How can I access the globalOptions in a component? #572

Answered by steffenbew
iconnoise asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, retrieving fields from a tab within a component should be straightforward:
While fields in tabs are visually nested, they're available on the top level in the data structure.

Here's an example:
BlockWysiwyg/functions.php: Definition of tabs (Content | Options) and fields (contentHtml, options).
BlockWysiwyg/index.twig: Rendering of fields (contentHtml, options.*).

Please also note that globalOptions are a different concept to store and retrieve settings for the whole site. With Options::addGlobal() you can add options to the Global Options page and retrieve them with Options::getGlobal().

If you require further support, please post your code snippet for further investigation of the p…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by iconnoise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants