Page 1 of 1
Use multiple Core Templates on pages.
Posted: Sat Jul 31, 2021 6:23 pm
by andrewvideouk
Hi guys
Its possible to multiple Core Templates on pages?
Basily I want to to have metadata stuff in a diffent Template as the main template is gettting big.
The Main Core Template
Code: Select all
<!DOCTYPE html>
<__html>
-->>>Other Template<<<--
</__body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<__body>
</__html>
Thank you
Re: Use multiple Core Templates on pages.
Posted: Sun Aug 01, 2021 3:18 pm
by DIGI3
You can either use template inheritance or generic templates (or a combination of both)
Template inheritance:
https://cmscanbesimple.org/blog/the-pow ... gn-manager
Generic templates:
Create a new generic template in Design Manager, put whatever you want in it and submit, then add {include file='cms_template:mygenerictemplatename'} where you want it to appear in your page template.
(protip: when you re-open your generic template it will have the embed tag available to copy & paste at the top)
Re: Use multiple Core Templates on pages.
Posted: Fri Sep 03, 2021 11:19 am
by andrewvideouk
Thank you very much I well give it a try. Do you know if i use {include file='cms_template:mygenerictemplatename'} does it behive like if its a one big template like seting variables etc. I want to have a separate template for the header and get variables from the main template. I am basic doing a google search json and other meta stuff. I am going to experiment with it.
Re: Use multiple Core Templates on pages.
Posted: Fri Sep 03, 2021 2:32 pm
by DIGI3
In most cases, variables will be passed down but not up, in inheritance. You can set the scope if you want them to be available everywhere, e.g. {$foo='bar' scope=global}