Using two different header templates
mark99 9
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Using two different header templates
Philipp Esselbach
From: -
Editor
0From: -
The easiest way to doing this is a small modification in the site_header template.
Click on “Add PHP part to this template” and add the following code to the PHP part:
Basically, the first stylesheet of the first template set will be used as default. For any pages that would be called from the content module the second stylesheet will be used. You can do this with any of the other modules.
You also need to change the following in the HTML part:
to:
If you prefer an external stylesheet instead, you need to change the PHP part like this:
This example would use the CSS from the first template set as default and an external CSS that is located at images/ss_main_content.css for the content page:
The HTML part must look like this:
Click on “Add PHP part to this template” and add the following code to the PHP part:
global $ct;
$stylesheet = 1;
if ($ct == "content") $stylesheet = 2;
Basically, the first stylesheet of the first template set will be used as default. For any pages that would be called from the content module the second stylesheet will be used. You can do this with any of the other modules.
You also need to change the following in the HTML part:
<link rel="stylesheet" type="text/css" href="https://www.contentteller.com/contentteller.php?ct=core&action=css&id={$insert['site_theme']}" title="Theme #{$insert['site_theme']}" />
to:
<link rel="stylesheet" type="text/css" href="https://www.contentteller.com/contentteller.php?ct=core&action=css&id={$stylesheet}" title="Theme #{$insert['site_theme']}" />
If you prefer an external stylesheet instead, you need to change the PHP part like this:
global $ct;
$stylesheet = "contentteller.php?ct=core&action=css&id=1";
if ($ct == "content") $stylesheet = "images/ss_main_content.css";
This example would use the CSS from the first template set as default and an external CSS that is located at images/ss_main_content.css for the content page:
The HTML part must look like this:
<link rel="stylesheet" type="text/css" href="https://www.contentteller.com/{$stylesheet}" title="Theme #{$insert['site_theme']}" />
I'm just getting use to the code but am trying to solve a small problem I have. Presently I use two slightly different style sheets in my existings sites header to manage the front page format separately from content sections.
That is to say, my index.html has one primary style sheet and a second one for some custom changes. So, for example, on my front page I might use these two. This allows me to use a radically different format on the front page without screwing up my divs and browser compatibility, while keeping the basic theme the same:
ss_main.css
ss_main_front.css
The main_front just takes some common stylesheet ID's and gives them a different format. Then for all the other content sections of my site I reverse this using another / different ss for those same ID's again:
ss_main.css
ss_main_content.css
Naturally this means that I have two header template files to call the two different CSS files and so my question is, am I able to define two different header templates for specific sections and or individual pages of the site with CT?