Page 1 of 1
[SOLVED] Adding links to same page in OpenCart
Posted: Mon Oct 21, 2013 6:43 am
by wiredleaf
Hey guys, I am trying to make an FAQ.
I would like links on top for the bottom content because it will be a large page.
This is what I have (the traditional method):
Code: Select all
<ul>
<li><a href="#faqaboutus">What is WiredLeaf all about</a></li>
</ul>
Thats for the links on top. For the bottom:
Code: Select all
<h1 id="faqaboutus">All about us</h1>
Just the normal way. But for some reason THIS DOES NOT WORK. When I click on the link, it goes to my home index page.
Any solutions guys? Cheers.
Re: Adding links to same page in OpenCart
Posted: Mon Oct 21, 2013 10:25 pm
by pedro1993
Could you provide a link? Does the URL in the address bar add "#faqaboutus" at the end?
Strange why it isn't working.
Peter
Re: Adding links to same page in OpenCart
Posted: Mon Oct 21, 2013 11:44 pm
by wiredleaf
pedro1993 wrote:Could you provide a link? Does the URL in the address bar add "#faqaboutus" at the end?
Strange why it isn't working.
Peter
Yes it does, it goes to
www.wiredleaf.co.uk/#faqaboutus
It is strange, its not an issue I have had before. The link is wiredleaf.co.uk/faq but i am in maintenance mode, as I don't launch til the 10th November. It is a custom page I have created using the traditional method. I have a feeling it is something to do with the way the dynamic pages work. I only have basic PHP skills but my front end is advanced, I've done same page links many times but I am baffled at this issue.
Re: Adding links to same page in OpenCart
Posted: Mon Oct 21, 2013 11:54 pm
by pedro1993
I don't think it will have anything to do with the CMS in OPenCart. If you can PM me details I don't mind having a quick look!
Peter
Re: Adding links to same page in OpenCart
Posted: Mon Oct 21, 2013 11:55 pm
by granddaddy
This problem was discussed at length in an earlier thread:
http://forum.opencart.com/viewtopic.php?p=66539#p66539
At the end a working solution was found by preceding the id in the href with the actual seo name of the same page, e.g...
if the page has an seo name of "what-is-wiredleaf", then try this:
<a href="what-is-wiredleaf#faqaboutus">
This apparently worked for others.
Re: Adding links to same page in OpenCart
Posted: Tue Oct 22, 2013 12:33 am
by wiredleaf
Cheers guys I'll try the seo method and if not ill pm you Peter.
Re: Adding links to same page in OpenCart
Posted: Tue Oct 22, 2013 1:44 am
by pedro1993
No problem

Re: Adding links to same page in OpenCart
Posted: Tue Oct 22, 2013 3:58 am
by wiredleaf
granddaddy wrote:This problem was discussed at length in an earlier thread:
http://forum.opencart.com/viewtopic.php?p=66539#p66539
At the end a working solution was found by preceding the id in the href with the actual seo name of the same page, e.g...
if the page has an seo name of "what-is-wiredleaf", then try this:
<a href="what-is-wiredleaf#faqaboutus">
This apparently worked for others.
I can confirm this works 100% perfectly.
My FAQ page is called FAQ.
Code: Select all
<ul class="faqlist">
<li><a href="faq#faqallabout">What is WiredLeaf all about?</a></li>
</ul
Links perfectly on the same page to:
Code: Select all
<h1 id="faqallabout">What is WiredLeaf all about?</h1>
First time I have had to link with the same page like this onto it, but you cant argue with success. Thanks alot for the help guys. This problem is officially SOLVED.
Re: [SOLVED] Adding links to same page in OpenCart
Posted: Tue Oct 22, 2013 4:22 am
by pedro1993
I'm glad you got it! I have updated the title to solved

Re: [SOLVED] Adding links to same page in OpenCart
Posted: Tue Oct 22, 2013 4:49 am
by wiredleaf
Cheers thank you very much Pedro!