-
- 43 Posts
comp_nerd26 - this is exactly what I was looking for. Works!
Thanks a lot!
(my case solved)
-
- 179 Posts
It might also be worth mentioning that the root cause of your problem is actually the <base> tag in your HTML, I suspect.
I've had the same trouble recently when trying to use named anchors and such for auto-scrolling. I've had to use a bit of a javascript to work around the issue in some specific cases, as opposed to considing removing <base href="[[+site_url]]"/> from the <head>. It's that which causes URLs like "#top" to be automatically prefixed with your site URL.
Tweaking your URLs to account for <base> is one approach, but should it turn out you don't really need <base> you'll find it a little easier to remove it. Depends on whether you want to be able to create # links regularly, and easily, or if you only need it for a single item, like a permanent menu item.
-
- 24,544 Posts
And if you have multiple front-end contexts, make it:
<base href="[[!+site_url]]"/>