Page 1 of 1

SOLVED: template tag: parent in hierarchy

Posted: Thu Oct 25, 2007 6:22 pm
by streever
hi all

ok!!! this is so easy

but I can't find it ;-)

what is the tag that you use to show the parent of the page?

site:
home
about
-about sub page 1

so, what tag echos back the parent ALIAS of about sub-page?

WHY DO I NEED THIS:
Well, because I wanna have the parent alias be in the body id="" so that I can set a background image. I know that sounds crazy! IT IS.

WHAT DID I ALREADY TRY:
calguys UDT.
http://forum.cmsmadesimple.org/index.ph ... 858.0.html

I tried that, and while it worked in it's original form, it doesn't work here.

The page alias it spits out is not the parent: it's blank!

so I need it to spit out the top level page alias at all times.

THANKS IN ADVANCE!!

Re: template tag: parent in hierarchy

Posted: Thu Oct 25, 2007 6:30 pm
by calguy1000
My UDT would spit out an empty string if the input page alias was already at the top level it wouldn't be hard to change it to just output the input alias.

Re: template tag: parent in hierarchy

Posted: Thu Oct 25, 2007 6:31 pm
by streever
Hey,

Right now, it's spitting out empty for the next level:

it just dawns on me, has the variable changed?

Currently it's "alias"

is it now page_alias?

it's been awhile since you wrote that...?

SOLVE Re: template tag: parent in hierarchy

Posted: Thu Oct 25, 2007 9:16 pm
by streever
Hey,

I just was doing it wrong! This UDT works perfectly.

I just put in the wrong value for page alias :D.

Re: SOLVED? template tag: parent in hierarchy

Posted: Mon Oct 29, 2007 8:46 pm
by 10010110
And how is it done now? It just happens that I need exactly the same functionality. I have several subpages and want them to display the alias of the parent page as ID of the body element. This way I don’t have to put every page’s ID in the stylesheet to style the pages that have the same code but look differently.

Could you write a step by step guide please?
What I’ve done is copy that UDT from the other thread (linked above), named it parent_alias and put the {parent_alias} tag into the body ID but… well, it shows nothing.

How is it done?

Re: SOLVED: template tag: parent in hierarchy

Posted: Sat Nov 10, 2007 6:41 pm
by streever
Hey there,

no problem

actually
I can direct you to a code I wrote too :D~!!!

it's a plugin called "section title"--it sounds like it does what you need.

I have a little help file too....

http://dev.cmsmadesimple.org/projects/sectiontitle/

let me know if that is what you need

just download file, then put it in your "plugins" folder