WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Template doesn't apply when it's a sub page
ruebenwurzel:
Hello,
link would be nice, so we can see what you mean.
Matthias
roachgirl:
Thanks for asking, Matthias
The two pages I'm referring to are off this page:
<removed>
The "Granola" page works, but is not in it's proper subdirectory. (Which I'm ok with, it's just an observation.)
The "Granola Bars" page is in it's proper subdirectory, but the template is not applying unless I make it a top level page. (not what they want.)
Thanks for putting your eye to this. I really appreciate it!
BerndJM:
Ok,
its' what i said in my above post:
The reference to your css is wrong.
The only "mistake" i made: I thought its a ragular installation where the css normaly is in the template directory. But your css seems to be in the installations root directory. Why that :?
Nevertheless try to change your call to the css file like this:
--- Code: ---<link href="<?php echo WB_PATH; ?>/style1.css" rel="stylesheet" type="text/css" media="all" />
--- End code ---
Regards Bernd
roachgirl:
Thanks Bernd,
I tried your new suggestion, but unfortunately it did not solve the problem :( Oh well. Worth a try!
I'm thinking it's not the style sheet that is the problem, because it would have the unformatted header and footer in the page. It's not finding the header and footer when it's in a subdirectory. Maybe that is a clue to someone who knows this better than me :)
Because you suggested it not finding the links, I tried to alter the links to the header and footer within the index.php of the template, but wasn't sure how I could. As soon as I altered it, it didn't help the page that was already broken (granola bars), and also broke the page that was ok before (granola).
<? include( "../header.php" ); ?>
<?php page_content();?>
<?
include( "../footer.php" );
?>
Any suggestions? Thanks everyone for checking this problem out! I really appreciate it :)
BerndJM:
Well maybe it's both
- not finding the stylesheet (this you can see clearly in the generated source code!)
- and not finding header/footer
but it's the same reason:
the reference is not ok
Try to explain:
../file.css
the .. means go one step higher in the folder hierarchy
so if you here:
/pages
it means look in the root for this file
but if you're here:
/pages/subdirectory
it means look in /pages (= one step higher)
to make it look in the root you must write:
../../file.css
So, if you handle with pages in subdirectories with different depth of the folder hierarchy, you can't wirte it in this way, because this notation don't fit all the possible cases, you have to write it in a way like this
--- Code: ---<? include( WB_PATH."/header.php" ); ?>
--- End code ---
for example to include the header
Regards Bernd
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version