I want to have hash link rewriting enabled for the entire site, but disabled for only one instance in a template because the rewriting is interfering with the function of a jQuery script associated with a few items on that page. Any ideas on how to accomplish this?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I've noticed that using single quotes, rather than double quotes, for the href attribute prevents the rewriting from occurring.
I can confirm this works and is a nice easy fix :).
Thanks for the tip!
I got around it temporarily by doing this:
public function CSPopLink() {
$filename = $this->Logo()->Filename;
$name = substr($filename, 0, strrpos($filename, '.'));
return "#pop-".$name;
}
When you return a link through the controller, it doesn't get the hash rewrite applied. It only happens in the template.