Layout Sections provide the ability to inject content into areas of the HTML outside of the Layout template. They support DotLiquid, but do not have a model available. The layout sections that are available are
- ~/Views/LayoutSections/HeadStart.liquid - will be injected immediately after the <head> tag in the page
- ~/Views/LayoutSections/HeadEnd.liquid - will be injected immediately before </head> tag in the page
- ~/Views/LayoutSections/BodyStart.liquid - will be injected immediately after <body> tag in the page
- ~/Views/LayoutSections/BodyEnd.liquid - will be injected immediately after </body> tag in the page
A Google Analytics code snippet is an example of when you'd use a Layout Section. The snippet for Google Analytics needs to exist at the top of the <head> tag. However, in this particular example, Google Analytics is already supported by B2B Commerce using the Analytics settings in the Admin Console: Administration > System > Settings > System Settings > Analytics section.
Updated 8 months ago