shogun Posted January 20, 2020 Share Posted January 20, 2020 How do you create a single field that is global across all pages and templates so that when its content is updated, it's updated every it exists on the website? Link to comment Share on other sites More sharing options...
Gideon So Posted January 21, 2020 Share Posted January 21, 2020 Hi @shogun, Welcome to the forum. There is no global field as far as I know. Gideon Link to comment Share on other sites More sharing options...
Kiwi Chris Posted January 21, 2020 Share Posted January 21, 2020 Although you can't create a global field, you can access fields from any page on any template, so you could create a settings 'page' that isn't visible on the site, but holds any fields that you want to use globally, and then access them in every template eg: $global = $pages->get('name=settings'); echo $global->myfield; Remember that in Processwire, everything is a 'page', but it doesn't have to be an actual visible page on your site. 4 Link to comment Share on other sites More sharing options...
dragan Posted January 21, 2020 Share Posted January 21, 2020 You could try https://modules.processwire.com/modules/settings-factory/ Probably overkill if you only really need one single field, but really useful if the number of such global fields increase over time... 1 Link to comment Share on other sites More sharing options...
shogun Posted January 21, 2020 Author Share Posted January 21, 2020 Excellent! Link to comment Share on other sites More sharing options...
shogun Posted January 28, 2020 Author Share Posted January 28, 2020 Can we use the same system to create a field that is on a template, that gets updated on all pages that use the template with the field? or is this the only way to do that... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now