Link doesn't behave as I'd expect


(Peter Danckwerts) #1

Creating a link in using the link button doesn’t work as I’d expect. I am creating a new site in a subdirectory so I’m using root-relative URL. However, if I use them with the link button the prefixed slash is stripped and the link fails. Of course, it’s easy enough just to enter the link by hand but this takes longer as one has to use ‘ignore formatting’ and it would be nice if the button worked as expected.


(Isaiah Carew) #2

This behavior is a user preference in RapidWeaver. RapidWeaver will tidy up any link that you give it – and does a bit more with links internal to your site.

In the lefthand sidebar under the Settings section click General. Then scroll to the bottom and click the button “Advanced”.

The first setting is “Relative to page” – and that’s what you’re seeing in action. I’m assuming that you are linking to a page from the homepage – or to a sub-page underneath the current one. In that case the “/” prefix is superfluous for a relative link. And you get a link that looks like:

<a href="subpage">Hello World</a>

but switching over to Relative to DOCROOT and republishing you’ll get this:

<a href="/subpage">Hello World</a>

There are advantages to both formats, of course. Relative tends to make some things a bit easier with a more deeply nested site. And then there’s relative to website address. I honestly don’t know why someone would choose that. :stuck_out_tongue:

Isaiah


(Peter Danckwerts) #3

Thanks, Isaiah. Doh! I knew about ‘Relative to page’ setting but it hadn’t occurred to me that it rewrote links created with the links button!