SOLVED: template tag: parent in hierarchy

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
streever

SOLVED: template tag: parent in hierarchy

Post 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!!
Last edited by streever on Thu Oct 25, 2007 9:17 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: template tag: parent in hierarchy

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
streever

Re: template tag: parent in hierarchy

Post 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...?
streever

SOLVE Re: template tag: parent in hierarchy

Post by streever »

Hey,

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

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

Re: SOLVED? template tag: parent in hierarchy

Post 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?
streever

Re: SOLVED: template tag: parent in hierarchy

Post 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
Locked

Return to “CMSMS Core”