Use multiple Core Templates on pages. Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Use multiple Core Templates on pages.

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Use multiple Core Templates on pages.

Post 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)
Not getting the answer you need? CMSMS support options
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Re: Use multiple Core Templates on pages.

Post 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.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Use multiple Core Templates on pages.

Post 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}
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”