# \<r:navigation\> Accessing Page Parts

**URL:** <https://www.ruby-forum.com/t/r-navigation-accessing-page-parts/75901>\
**Category:** Radiant CMS\
**Created:** [November 14, 2006, 4:55am UTC](https://www.ruby-forum.com/t/r-navigation-accessing-page-parts/75901 "2006-11-14T04:55:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillippe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@Phillippe](https://www.ruby-forum.com/u/Phillippe)\
**Post date:** [November 14, 2006, 4:55am UTC](https://www.ruby-forum.com/t/r-navigation-accessing-page-parts/75901/1 "2006-11-14T04:55:34Z")

</div>

I have been fighting with creating a navigation which accesses a page  
part from the looped list of urls rather than the usual \<r:title\>,  
\<r:url\> …

So instead of using \<r:title\> I have created a page part named alt\_title  
and have tried accessing it as you normally would: \<r:content  
part=“alt\_title” /\> but within the navigation tags:

\<r:navigation urls=“Home:/; History:/about/history/; About:/about/;  
Services:/services/”\>  
\<r:normal\>\<r:content  
part=“alt\_title” /\>\</r:normal\>  
\<r:here\>**» \<r:content part=“alt\_title”  
/\>**\</r:here\>  
\<r:selected\>\<r:content part=“alt\_title” /\>\</r:selected\>  
\</r:navigation\>

All I get in place of \<r:content part=“alt\_title” /\> is the current  
pages alt\_title and not that of the pages that are being linked in the  
navigation.

Is there any way to access page parts rather than just the main  
\<r:title\>, \<r:slug\>, et al?

---

<div class="post-metadata">

**Author:** ![Phillippe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@Phillippe](https://www.ruby-forum.com/u/Phillippe)\
**Post date:** [November 14, 2006, 4:00pm UTC](https://www.ruby-forum.com/t/r-navigation-accessing-page-parts/75901/2 "2006-11-14T16:00:45Z")

</div>

Phillippe wrote:

> All I get in place of \<r:content part=“alt\_title” /\> is the current  
> pages alt\_title and not that of the pages that are being linked in the  
> navigation.
> 
> Is there any way to access page parts rather than just the main  
> \<r:title\>, \<r:slug\>, et al?

No. The \<r:navigation /\> tags are poorly designed and don’t actually  
switch the context of the tags like other Radiant tags do. You may need  
to resort to using \<r:if\_url matches=“…”\> blocks.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Phillippe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@Phillippe](https://www.ruby-forum.com/u/Phillippe)\
**Post date:** [November 14, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/r-navigation-accessing-page-parts/75901/3 "2006-11-14T21:52:03Z")

</div>

> Phillippe wrote:
> 
> > All I get in place of \<r:content part=“alt\_title” /\> is the current  
> > pages alt\_title and not that of the pages that are being linked in the  
> > navigation.
> > 
> > Is there any way to access page parts rather than just the main  
> > \<r:title\>, \<r:slug\>, et al?

John W. Long said - on 14/11/2006 7:57 AM-\>

> No. The \<r:navigation /\> tags are poorly designed and don’t actually  
> switch the context of the tags like other Radiant tags do. You may need  
> to resort to using \<r:if\_url matches=“…”\> blocks.
> 
> –  
> John L.  
> [http://wiseheartdesign.com](http://wiseheartdesign.com)

Agreed, and I realised that the context never changed about 5 minutes  
after posting. I went with some simple \<r:find\_url\> along with a snippet  
to save some repetition. It’s not very elegant or as DRY as I’d like but  
it’ll do.
