Post by chrisplaneta » Wed Oct 20, 2010 10:58 pm

Hi everyone.

I have noticed a very queer behaviour of internal links. Pointing to a div item with a link on the same page doesn't work.

<a href="#id_name">foo</a>
...
content
...
<div id="id_name">bar</div>

The link's href ( often shown at the bottom of a browser when the link is hovered over) should look like that:

Code: Select all

http://sitename/Full_Url_to_thisPage#id_name.
After the link is clicked the page should scroll down to the div with relevant ID. Not here however. The url is shortened to:

Code: Select all

http://sitename/#id_name. 
You can see it working on one of my earlier sites (this one was never released) - http://chrisplaneta.com/demos/myfirstwp ... th_photos/ . When you hover over the butterfly it should show you the list of items it can scroll down to (animation covered by JS).

Before you start saying anything I have to tell you that this technique of internal linking worked for me in a few projects no problem. What is more, the static version of this site also worked fine. The code in Opencart is implemented directly in PHP.

What is happening? Do you also have problems with that? How can I make it work?

Edit. Just checked that internal linking doesn't work with the usual link > link too.

Go visit me at http://ChrisPlaneta.com

If you are a temaplate developer you might be interested in my nude Opencart theme - Cornerstone. It is available for download from this site http://chrisplaneta.com/freebies/corner ... art-theme/


User avatar
Newbie

Posts

Joined
Fri Oct 08, 2010 8:47 pm

Post by jones » Thu Oct 21, 2010 1:48 pm


Active Member

Posts

Joined
Tue Aug 24, 2010 1:05 pm

Post by chrisplaneta » Thu Oct 21, 2010 4:28 pm

Hi jones.

Unfortunately the solution for my problem can't be found there. Thanks for a reply though.

Go visit me at http://ChrisPlaneta.com

If you are a temaplate developer you might be interested in my nude Opencart theme - Cornerstone. It is available for download from this site http://chrisplaneta.com/freebies/corner ... art-theme/


User avatar
Newbie

Posts

Joined
Fri Oct 08, 2010 8:47 pm

Post by firegazer » Sat Oct 01, 2011 10:29 pm

For anyone who still has this issue (it works much the same in 1.5.X), I'm afraid my solution has had to be hardcoded as follows:

Code: Select all

<a href="//www.baseurl.com/hardcode-link#A">Internal Link to A</a>
...
<div id="a"></div>
If anyone has found a better solution than this, it is naturally welcome, but this will work in a pinch.

Newbie

Posts

Joined
Thu Sep 29, 2011 6:44 am
Who is online

Users browsing this forum: No registered users and 10 guests