Get parent title inside template

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
yabune
Forum Members
Forum Members
Posts: 40
Joined: Wed Dec 05, 2007 7:28 pm

Get parent title inside template

Post by yabune »

Hi,

Is it possible to check in the template, if the current page has a certain parent?

I know $page gives me the current page, what about its parent?

I would like to add a div if I'm inside a certain parent page.

Thanks!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Get parent title inside template

Post by calguy1000 »

it's something like:

Code: Select all

{capture assign='parent_page'}{$ccuser->parent_page_alias()}{/capture}
{if $parent_page == 'whatever'}
  <div id='blah'>
     ...
  </div>
{/if}
the customcontent help should give you the exact name of the function.
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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Get parent title inside template

Post by RonnyK »

This topic

http://forum.cmsmadesimple.org/index.ph ... l#msg53453

describes a UDT that will give you back the parents alias as well.

Ronny
Post Reply

Return to “Layout and Design (CSS & HTML)”