21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 493 Views |
-
CMS auto inserting page URL before # anchor

14 September 2011 at 7:18pm
Hi everyone
I have an issue, SS is auto putting URL into my A tags...
<ul class="tabs"><li><a href="northampton-seo-company#tab1">Real SEO Company</a></li>
<li><a href="northampton-seo-company#tab2">The RIGHT choice</a></li>
<li><a href="northampton-seo-company#tab3">Our Ethics</a></li>
<li><a href="northampton-seo-company#tab4">Here to help!</a></li>
</ul>in the CMS it is
<ul class="tabs"><li><a href="#tab1">Real SEO Company</a></li>
<li><a href="#tab2">The RIGHT choice</a></li>
<li><a href="#tab3">Our Ethics</a></li>
<li><a href="#tab4">Here to help!</a></li>
</ul>How do I turn it off? As my script wont work with the first example...
Any help would be great! thanks,
-
Re: CMS auto inserting page URL before # anchor

14 September 2011 at 7:55pm
SS does that automatically to fix any issues with having the base url defined. You can disable the behavior using SSViewer:: dontRewriteHashlinks();
http://api.silverstripe.org/2.4/sapphire/view/SSViewer.html#methoddontRewriteHashlinks
-
Re: CMS auto inserting page URL before # anchor

14 September 2011 at 9:15pm
Hi willr
thanks for that. Does this go into mysite/_config.php?
cheers
-
Re: CMS auto inserting page URL before # anchor

15 September 2011 at 12:00am
Got it working.
You edit the code in mysite/code/page.php.
Simply add the line to:
public function init() {
parent::init();...
SSViewer::dontRewriteHashlinks();thanks
| 493 Views | ||
|
Page:
1
|
Go to Top |


