<r:navigation> Accessing Page Parts

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?

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

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

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs