Make fields from new Global Options available in header twig template #475
-
I've managed to add fields to Global Options by duplicating functions.php from BlockCookieNotice and adapting: `<?php namespace Flynt\Components\SocialLinks; use Flynt\Utils\Options; add_action('wp_footer', function () { Options::addGlobal('SocialLinks', [ How do I now make the fields available to my header twig template? A Dump doesn't currently show any social fields available. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Iain-g the default approach is using the If you want to render the component SocialLinks with twig you can add If you want create fields which should be available for multiple components without any layout logic you can take a look on the sliderOptions.php inside the inc folder. Which will then added to the component |
Beta Was this translation helpful? Give feedback.
Hi @Iain-g the default approach is using the
renderComponent
twig function. What do you mean with header twig template and what exactly do you want to to do?If you want to render the component SocialLinks with twig you can add
{{ renderComponent("SocialLinks") }}
into any .twig file.If you want create fields which should be available for multiple components without any layout logic you can take a look on the sliderOptions.php inside the inc folder. Which will then added to the component
SliderImages
inside its functions.php.