Hi Sean,

top level means top level within this page, not within the website
hierarchy.

You can browse the website hierarchy using Magnolia API from within your
template jsp. So you get the top level title with this jsp scriptlet:

Iterator it = Resource.getActivePage(request).getAncestors().iterator();
Content c = (Content) it.next();
String title = c.getNodeData("title").getString();

Ralf

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 19. Juli 2006 18:47
An: [email protected]
Betreff: [magnolia-user] Getting an Attribute from a Higher-Level Page

I've hit a template development question that's stumped me.

I have several sites in my Websites repository:

* physical-therapy
* technology-resources
* etc.

Each site, of course, has several pages in it:

* technology-resources
  * contact
    * admininstration
    * tech-support
  * purchasing
    * personal
    * institution
  * security

I would like my template to display the title of the site (from
"/technology-resources/title") regardless of what page I'm on in the
technology-resources site. That is, when I'm looking at the "institution"
page, I'd like to have access to the "Technology Resources" title from up
the content tree.

Based on the tag docs, I thought this would do the trick:

<cms:out nodeDataName="title" contentNodeName="" />

The docs say that if you use contentNodeName="", "the top level content is
taken". But when I use this, the title of the page that I'm currently
looking at is displayed instead, just as if I'd omitted the contentNodeName
attribute altogether.

So, am I misunderstanding the docs, or is something else going on here?

Thanks for any input.

Sean


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to