(Paul Pogonoski) wrote:
Hi, again.

I've thought about this a little more, and what I want to do is display the
title of the page on the top-level branch for the current page.
E.g.
Top1
        next1
                next_next1
Top2
        next2
                next_next2

Say I was on page next2 or next_next2, what I want displayed is the title of
Top2, only.

This could be done easily with the breadcrumb tag if it had a endLevel
parameter, and I could set both the "1".

So I have two questions:
1. what are the steps I have to do, apart from extending the breadcrumb
class, to add the endLevel parameter to the breadcrumb tag?
2. what other ways does anyone have to make this work?

Cheers,
PP
-----Original Message-----
From: Paul Pogonoski [mailto:[EMAIL PROTECTED] Sent: Saturday, 19 November 2005 1:03 PM
To: [email protected]
Subject: [magnolia-user] determining page level

Hi,
I'd like to be able to display the page title in a title are of the selected
page and think the easiest way to do this is to use the breadcrumb tag.
However, to make this work I'll have to set the startLevel parameter of the
tag to the level the user is now on.

So, how do I determine what level the select page is on?

I'm using Magnolia 2.1.4.

Cheers,
Paul
I think what you would want to do is use the getAncestor() method of the Content class.

Here is an example:

<jsp:scriptlet>
   <![CDATA[
        Content activePage =  Resource.getActivePage(request);
         String sectionHeadTitle = activePage.getAncestor(1).getTitle();
         pageContext.setAttribute("sectionHeadTitle", sectionHeadTitle);
   ]]>
</jsp:scriptlet>

<p>The title of the current section of pages is: <c:out value="${sectionHeadTitle}" />.</p>


That should work for both next2 and next_next2 to get the title of Top2. Sorry if I misunderstood you. I have no idea what the breadcrumb tag is or how it works.

--
Adam Cooper
Talisen Technologies
E: [EMAIL PROTECTED]



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

Reply via email to