shogun Posted January 20, 2020 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?
Gideon So Posted January 21, 2020 Posted January 21, 2020 Hi @shogun, Welcome to the forum. There is no global field as far as I know. Gideon
Kiwi Chris Posted January 21, 2020 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
dragan Posted January 21, 2020 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
shogun Posted January 28, 2020 Author 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...
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