Page 1 of 1
Anchors in Info Pages Not Working
Posted: Fri Apr 16, 2010 10:32 pm
by rmeo
I am having trouble getting text anchors to work within a page.
When I click the beginning anchors it takes me back to the home page and adds a "/#" to the end of the URL.
Any ideas on why it is doing this and how I can fix it?
Thanks in advance
Ryan
Re: Anchors in Info Pages Not Working
Posted: Fri Apr 16, 2010 11:05 pm
by Qphoria
The controller system is likely trying to read the anchor as a file path. By default if a path isn't found, instead of showing an ugly 404 error, it hides the error and just redirects to the homepage. i'll see what is involved with preventing that
Re: Anchors in Info Pages Not Working
Posted: Fri Apr 16, 2010 11:14 pm
by rmeo
Appreciate the help very much!
Look forward to some fixes that can be made.
Re: Anchors in Info Pages Not Working
Posted: Sat Apr 17, 2010 1:04 am
by rph
It's not the most desirable solution but you can get around it by hardcoding your links to something like:
Code: Select all
http://mystore.com/index.php?route=information/information&information_id=8#faq01
If you use SEO URLs it's a little easier:
Re: Anchors in Info Pages Not Working
Posted: Sat Apr 17, 2010 6:58 am
by Xsecrets
Qphoria wrote:The controller system is likely trying to read the anchor as a file path. By default if a path isn't found, instead of showing an ugly 404 error, it hides the error and just redirects to the homepage. i'll see what is involved with preventing that
actually this is really not a good idea, and quite a big problem with seo, and the crazy part is it only acts like that if you have seo urls turned on.
Re: Anchors in Info Pages Not Working
Posted: Tue Jun 29, 2010 1:06 pm
by vkaltchev
rmeo wrote:Appreciate the help very much!
Look forward to some fixes that can be made.
I have the same problem; the anchor is kicking me back to the homepage. Any resolution???
In an older post Qphoria mentioned that anchor is so 1999 - what can I replace it with when I have a long list of FAQ?
Thanks in advance.
Cheers,
Valentina
Re: Anchors in Info Pages Not Working
Posted: Tue Jun 29, 2010 7:58 pm
by Xsecrets
rph posted the solution a couple of post above.
Re: Anchors in Info Pages Not Working
Posted: Thu Jul 08, 2010 9:45 pm
by colevr
Yeah, this is a solution, but if you are talking about the "Terms and Conditions" page the things come a little more harder...In fact, if we use the friendly url system, it's possible to have anchors working, but in phase of order, if a client (before accept) click on "term and condition", here happens that the poor guy is redirected through the page linked and loose the possibility to go on with the buy. AS the terms and condition page is hosted in a popup window that don't use friendly-url....
At this point I don't know what to do...Any idea?
Re: Anchors in Info Pages Not Working
Posted: Fri Jul 09, 2010 4:01 am
by schmadam
Isn't this a problem with the base href? i.e. the base href on the page is set to the site root so all relative links, including anchors, will start with that.
Here is a jQuery workaround if that's feasible - it worked for me:
http://www.cariboucms.com/blog/jquery-b ... nchors-fix
Re: Anchors in Info Pages Not Working
Posted: Mon Aug 09, 2010 8:08 am
by ThatBlokeRob
schmadam wrote:Isn't this a problem with the base href? i.e. the base href on the page is set to the site root so all relative links, including anchors, will start with that.
Here is a jQuery workaround if that's feasible - it worked for me:
http://www.cariboucms.com/blog/jquery-b ... nchors-fix
Works perfectly! Thanks schmadam
Re: Anchors in Info Pages Not Working
Posted: Tue Oct 26, 2010 12:03 am
by mobi
ThatBlokeRob wrote:schmadam wrote:Isn't this a problem with the base href? i.e. the base href on the page is set to the site root so all relative links, including anchors, will start with that.
Here is a jQuery workaround if that's feasible - it worked for me:
http://www.cariboucms.com/blog/jquery-b ... nchors-fix
Works perfectly! Thanks schmadam
Hi there,
Any ideas where I can actually insert the script to make this work?
The source in the wysiwyg doesnt go as far up as header. (sorry bit of a newb)
Mobi
Re: Anchors in Info Pages Not Working
Posted: Sun Jul 31, 2011 2:33 am
by will_c
Hello all - just in case anyone else is still struggling with this - I think I've figured it out!
All you need to do is create the anchor as normal for the part of the page you wish to reference and then choose link to URL when you are creating the hyperlink to the anchor, and not link to Anchor.
When you type the URL in just add #anchorname at the end and it seems to work.
Hope this helps someone else.
I'm using vs 1.5.1.
Re: Anchors in Info Pages Not Working
Posted: Mon Aug 15, 2011 2:01 pm
by funt
Dear Will_c,
well done!
that does the trick for me in the info pages as well. No hassle with javascripting....
Thanx.
John
Re: Anchors in Info Pages Not Working
Posted: Fri Sep 02, 2011 4:44 am
by funt
What also works is the following. If you have a page called Frequently Asked Questions and you have this page called in seo FAQ you can point to just FAQ.
In other words. Create an anchor called Anwer1. Create a link (not internal link) for example on Question1, use protocol <other> (not http://) and you just can use url: FAQ#Answer1.
You don't have to type all the url.
Re: Anchors in Info Pages Not Working
Posted: Wed Mar 21, 2012 8:13 pm
by ukdazza
funt wrote:What also works is the following. If you have a page called Frequently Asked Questions and you have this page called in seo FAQ you can point to just FAQ.
In other words. Create an anchor called Anwer1. Create a link (not internal link) for example on Question1, use protocol <other> (not http://) and you just can use url: FAQ#Answer1.
You don't have to type all the url.
Spot on.