21489 Posts in 5783 Topics by 2621 members
General Questions
SilverStripe Forums » General Questions » Disable hash link rewriting for a particular instance
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1095 Views |
-
Disable hash link rewriting for a particular instance

19 January 2011 at 4:47pm
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?
-
Re: Disable hash link rewriting for a particular instance

19 January 2011 at 6:49pm
I've noticed that using single quotes, rather than double quotes, for the href attribute prevents the rewriting from occurring.
-
Re: Disable hash link rewriting for a particular instance

23 February 2011 at 1:33pm Last edited: 23 February 2011 1:33pm
I can confirm this works and is a nice easy fix
. -
Re: Disable hash link rewriting for a particular instance

23 February 2011 at 4:41pm
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.
| 1095 Views | ||
|
Page:
1
|
Go to Top |


