Ruby Forum Radiant CMS > Root Relative Linking

Posted by Ben Morrow (benmorrow)
on 11.08.2008 16:29
I have a main navigation set up like so:

<r:navigation urls="About:/about/| Blog:/blog/| Portfolio:/portfolio/">

I would like for the Blog link to be root relative, meaning that
whereever the user is on the site, they will always go to a child of the
root when they click a link.

So if a person is on www.site.com/misc/blah/blah and they click the blog
link they should be taken to www.site.com/blog.

However the way it is working now, they would be taken to
www.site.com/misc/blah/blog.

This is due to the fact that the link created by the navigation tag
looks like this:

<a href="blog"> ... instead of <a href="/blog/">.

So, how can I get the navigation tag to maintain my forward slashes, and
thus allow root relative linking?

Cheers!
Ben
Posted by Edmund Haselwanter (Guest)
on 11.08.2008 16:42
(Received via mailing list)
On 11.08.2008, at 16:29, Ben Morrow wrote:

> So if a person is on www.site.com/misc/blah/blah and they click the  
>
> So, how can I get the navigation tag to maintain my forward slashes,  
> and
> thus allow root relative linking?
>

How do you "implement" your navigation area? just checked, and with

   <div id="nav">
     <ul><li><r:navigation urls="About:/about/| Blog:/blog/|
Portfolio:/portfolio/">
   <r:normal><a href="<r:url />"><r:title /></a></r:normal>
   <r:here><strong><r:title /></strong></r:here>
   <r:selected><strong><a href="<r:url />"><r:title /></a></strong></
r:selected>
   <r:between> | </li><li> </r:between>
</r:navigation></li>
     </ul>
   </div>

as a snippet this gets rendered as

   <div id="nav">
     <ul><li><a href="/about/">About</a> | </li><li> <a href="/
blog/">Blog</a> | </li><li> <a href="/portfolio/">Portfolio</a></li>
     </ul>

   </div>

cu edi

--
DI Edmund Haselwanter, edmund@haselwanter.com, 
http://edmund.haselwanter.com/
Posted by Ben Morrow (benmorrow)
on 11.08.2008 17:14
Edmund Haselwanter wrote:

> How do you "implement" your navigation area? just checked, and with

Thanks for the reply Edmund.

Turns out it was a false alarm. I forgot to change the links from being 
hard coded to using the snippet.