Developer forum

Forum » Templates » Name of the page

Name of the page

Morten Vallentin
Reply
I need to catch the name of a page in the menu hierarchy, but forgot the tag
Quick help anyone?

Page lvl 1
    Page lvl 2 (need to catch this name)
        Page lvl 3 (i am here)

Replies

 
Vladimir
Reply
Hi Morten,
        <xsl:if test="@AbsoluteLevel>2">
          <xsl:value-of select="../@MenuText" disable-output-escaping="yes"/>
        </xsl:if>

Best regards,
Vladimir

 
Morten Vallentin
Reply
Hi Vladimir,
Thanks, i will keep this for a time, when I have the skills to work the xslt.

In the meantime what i am really looking for - I'm sure it exists - is the "native" DW tag for catching a Pagename on a certain level.

Kind regards
 
Vladimir
Reply
 Hi Morten,
I' afraid that there is no such tag... but you can create a page template extender, something like:
Dim currentPage As Frontend.Page = PageView.Current.Page
Dim parentPage As Frontend.Page = PageView.Current.Page.FindPage(Base.ChkInteger(currentPage.Value("PageParentPageID")));
template.SetTag("@ParentName", parentPage.Name)
Best regards,
Vladimir
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Small correction:
template.SetTag("@ParentName", parentPage.Name)

should be:
template.SetTag("ParentName", parentPage.Name)

without the @. That has thrown me off a couple of times in the past ;-)

Imar
 
Vladimir
Reply
Hi Imar, you are right, thank for correction.
Vladimir

 

You must be logged in to post in the forum