Two different header files.

Permalink
I'm working on new site that calls for 2 different headers, one for the homepage and other for the rest of the pages. so far i have been unable to make it work by simple changing this piece of code from

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php'); ?>

to

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header2.php'); ?>

Any Ideas?

This is the error i'm getting:

Warning: include(/home/clandeld/public_html/casadelasestrategias.com/concrete/themes/casa_estrategias/elements/header2.php) [function.include]: failed to open stream: No such file or directory in /home/clandeld/public_html/casadelasestrategias.com/concrete/core/libraries/view.php on line 484

Warning: include() [function.include]: Failed opening '/home/clandeld/public_html/casadelasestrategias.com/concrete/themes/casa_estrategias/elements/header2.php' for inclusion (include_path='/home3/clandeld/public_html/casadelasestrategias.com/libraries/3rdparty:/home/clandeld/public_html/casadelasestrategias.com/concrete/libraries/3rdparty:.:/usr/lib/php:/usr/local/lib/php') in /home/clandeld/public_html/casadelasestrategias.com/concrete/core/libraries/view.php on line 484

 
planist1 replied on at Permalink Reply
planist1
Try this:

1 - make sure you have two different header files saved (example header.php and header2.php
2 - you have a default.php page created
3 - you copy the default.php and rename it as let's call it... otherpage.php
4 - make sure the default.php page has the following at the top:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $this->inc('elements/header.php'); ?>

5 - make sure the otherpage.php has the following at the top:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $this->inc('elements/header2.php'); ?>

6 - Go to dashboard - > Themes and click the inspect button next to your active theme

7 - Is should show the new page type of otherpage listed, click ok
8 - Clear your cache
9 - Create a new page in the CMS and choose the otherpage page type.