Template doesn't apply when it's a sub page

roachgirl

#11
Thanks BerndJM :)

Your tip helped for the header and footer, but the style sheet was holding out on me :( So... I figured, eff it. I put in literal links for the style sheet!  :-P Done!

Much appreciation for your help!! :)  :-D You're the greatest!

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
<? include( WB_PATH."/header.php" ); ?>   
for example to include the header

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

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

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:
<link href="<?php echo WB_PATH?>/style1.css" rel="stylesheet" type="text/css" media="all" />

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

roachgirl

#7
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!

ruebenwurzel

Hello,

link would be nice, so we can see what you mean.

Matthias

roachgirl

Thanks Bernd for the tip, but it didn't seem to help. There was no change in the page in the subdirectory. It did, however seem to affect the other page that was previously working. (the one that was in the main directory, but is a sub page.) It broke it, so I know that it did affect something by making that change.

Hmmm...

BerndJM

Hi,

please have a look at the index.php of the choosen template.
What looks the link to the css file (most screen.css) like?
If it looks like this:
<link href="../templates/xxx/screen.css" rel="stylesheet" type="text/css" media="screen" />
You should it change to this:
<link href="<?php echo TEMPLATE_DIR?>/screen.css" rel="stylesheet" type="text/css" media="screen" />

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

roachgirl

#3
Christian, thanks so much for your speedy reply!

Forgive the "stupid question", how do I access the "backend"?

Is this access different than accessing the administration pages? ( www.mysite.com/admin/ )

Regarding the template that is applied: both sub pages have a template that is called "gluten" not "blank", all of the settings are mirrored, the one difference I could find was that the page that worked was not in it's proper sub-directory, it was at the top level of the site.

Thanks again for your help!

doc

Hello,

check if a template other than blank is choosen for the sub pages (Backend -> Pages -> Settings of your sub page -> Template).

Regards Christian

roachgirl

I'm picking up an existing site that was created by someone else & have found that the template doesn't apply when a page is identified as a sub page. When it has no parent, the template applies fine. As soon as I identify a parent for it, the template doesn't apply and only the page content is visible.

The site has pages that are already sub pages. (They have parent pages.) The strange thing about all this is the php files that work aren't physically in the directory that they say they're supposed to be in, so I am thinking that the person who established this website probably came across the same issue and has manually done a workaround for this issue.

For example:
www.mysite.com/parent/subpage.php
is really located up one level:
www.mysite.com/subpage.php

When I create a new page, and give it a parent, it places it (naturally) within it's parent directory (www.mysite.com/parent/subpage2.php ), and that's where the template doesn't seem to be applying! Grr!

Has anyone come across this? Any suggestions are gratefully appreciated. I've obsessed over this for a day, and have gotten nowhere on it!

Thanks so much for your help!