Global content is content that can be reused across your templates to create consistent pieces of information such as website headers, footers, sidebars, logos, or other components.
global partial
.
This will create your template in the desired directory with the following template annotations included in the HTML file.
dnd_area
tags similar to enabling them in page templates. View our Drag and Drop Area documentation for more information.
global_partial
HubL tag while referencing the path to your partial. Below is an example from the CMS boilerplate using this tag.
<div>
around the global partial. This is used by the page editor to identify that the piece of content is a global partial.
global_partial
within the <head>
of a template. Doing so would result in invalid HTML.In most situations where you’d want to use a global partial in the header, it may make more sense to use a global module instead with a {%require_head%}
to insert custom code into the head, and still provide module fields.hs create
command, as shown below.
global
flag in the module’s meta.json
file.