Global fields can be used globally in any existing section. Examples of global content: Address, phone numbers, email, navigation, footer content and so on.
Notice: There can be several global sections. I usually have at least 3: Globals, Header and Footer. Every time you want to add a field to the template, use the handle of the section instead of "entry.".
Example:
Header -> header.NameOfTheField
Footer -> footer.NameOfTheField
Globals -> globals.NameOfTheField
- Go to Craft CMS -> Backend -> Settings (Leftside Menu) -> Globals
- Click on “+ New global set” button
- Give it a name and the handle will be created automatically
- Create a New Tab inside the table by pressing "+ New Tab" and give it name.
- Select the Field from the right table and drag and drop it into the table.
- Press "Save" in the right top corner button
- Now, in the main Leftside Menu, there is a new Tab called "Globals". Click on it!
- You can now edit the content you wish to show in Front-End
- Adding the field to the template: Let's assume there is a field called "Heading" in the Globals section. The handle of the "Globals" section is the same as the name, except that you have given it a different handle. To add it into the template, simply write the following code: