#1 August 6, 2015 3:03pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Alternate Header/Footer with Routed Template

I'm trying to setup a routed template but the design requires an alternative header/footer than our standard ones. However, routed templates seem to pull in the _header.php and _footer.php files even if my routed/default.php file is completely blank. Is there anyway I can set it to not automatically pull in those files? Is my only choice to modify my router.php file?

Thanks

Offline

#2 August 6, 2015 3:06pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Alternate Header/Footer with Routed Template

If you're referring to /templates/layouts/_header.php (and footer.php), you'll want to change the layout:

<?
    $bigtree["layout"] = "new-layout";
?>

That causes your template to load into /templates/layouts/new-layout.php instead of /templates/layouts/default.php. You'll want to echo $bigtree["content"]; to dump your template file into your new layout.

If you're referring to _header.php in your routed template's directory, you can always dump any markup that creates via "ob_clean();" -- not sure there's a way to get around markup from _footer.php, though.

Offline

#3 August 6, 2015 3:39pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: Alternate Header/Footer with Routed Template

Oh ok that makes sense. I was just defining my layout in the wrong spot.

Thanks for your help.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.