21310 Posts in 5739 Topics by 2604 members
| Go to End | Next > | |
| Author | Topic: | 3250 Views |
-
SilverStripe adds slashes to my anchors

14 January 2009 at 7:46am
In one of my templates, I have a small jquery-based tab box. The tab box's navigation relies on anchors to function, so I have something similar to this in the template:
<ul class="tabNavigation">
<li><a class="selected" href="#first">$Tab1Title</a></li>
<li><a class="" href="#second">$Tab2Title</a></li>
<li><a class="" href="#third">$Tab3Title</a></li>
<li><a class="" href="#fourth">$Tab4Title</a></li>
</ul>unfortunately, whenever SilverStripe parses this template, it adds a slash, '/' to my anchors, which breaks my javascript tabs. Is this a bug or some kind of option that I can turn off in SilverStripe?
When I view the source in my web browser I see this:
<ul class="tabNavigation">
<li><a class="selected" href="/#first">$Tab1Title</a></li>
<li><a class="" href="/#second">$Tab2Title</a></li>
<li><a class="" href="/#third">$Tab3Title</a></li>
<li><a class="" href="/#fourth">$Tab4Title</a></li>
</ul>Thanks!
-
Re: SilverStripe adds slashes to my anchors

14 January 2009 at 8:58am
I found out how to disable the rewriteHashlinks option, but it turns out that the hashes aren't really the issue. there's something else going on with my javascript, I think.
-
Re: SilverStripe adds slashes to my anchors

3 July 2009 at 10:08pm
i have the same problem...
how and where did you disable the rewriteHashlinks option? -
Re: SilverStripe adds slashes to my anchors

4 July 2009 at 9:46pm
@derralf add this to your config file SSViewer::setOption('rewriteHashlinks', false);
-
Re: SilverStripe adds slashes to my anchors

4 July 2009 at 10:20pm
@willr thanks!
i already found this snippet yesterday.
additional you have to apply this bugfix to /sapphire/core/SSViewer.php to really really disable hashlink rewriting:
http://open.silverstripe.com/changeset/76529 -
Re: SilverStripe adds slashes to my anchors

9 July 2009 at 12:00am
When I on a page like this:
And in my .ss I write this code:
<li><a href="#tabs">Tab1</a></li>
SilverStripe makes this code:
<li><a href="contact#tabs">Tab1</a></li>
How can I disable, that he place 'contact' in front of # ?
-
Re: SilverStripe adds slashes to my anchors

9 July 2009 at 1:04am Last edited: 9 July 2009 1:04am
> http://open.silverstripe.com/changeset/76529
This code doenst work ...
-
Re: SilverStripe adds slashes to my anchors

9 July 2009 at 5:32am
hmm... worked good for me, just did these 2 things:
i put the snipped from willr in my _config.php: SSViewer::setOption('rewriteHashlinks', false);
and in my sapphire/trunk/core/SSViewer.php i put the fix from http://open.silverstripe.com/changeset/76529 by replacing the "red part" by the "green part".
(with Silverstripe 2.3.2 stable)
| 3250 Views | ||
| Go to Top | Next > |




