Author Topic: How to insert anchor link?  (Read 4668 times)

Offline iron

  • Newbie
  • *
  • Posts: 19
  • Karma: +4/-0
    • View Profile
How to insert anchor link?
« on: May 10, 2016, 10:46:51 AM »
Hello guys! I didn't find nothing about my problem here on this forum.

I'm trying to put anchor link on a Product page. Doing it as usual (Pic.1, Pic. 2). Saving the file.
In HTML/Text mode all tags are on their places. In Visual mode everything seems OK, but in Link menu the anchor not saved (Pic. 3). And on storefront page, if move mouse on link in list, link seems workable (Pic. 4), but click on any link opens the main page.
Absolutely have no idea how to fix it.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5795
  • Karma: +274/-2
    • View Profile
Re: How to insert anchor link?
« Reply #1 on: May 11, 2016, 05:21:43 AM »
Hi.

To fix anchors your need to put full url in your href or add this code to the product pages
Code: [Select]
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery("a[ href ^= '#' ]").each(function() {
        var href = window.location + jQuery(this).attr('href').replace('/#.*/i','');
        jQuery(this).attr('href',href);
    });
});
</script>

It is very easy to add code via HTML block http://docs.abantecart.com/pages/design/blocks/html_block.html
Create HTML block with this code and add it to the Product page layout

Offline iron

  • Newbie
  • *
  • Posts: 19
  • Karma: +4/-0
    • View Profile
Re: How to insert anchor link?
« Reply #2 on: May 11, 2016, 12:36:27 PM »
Thank you Basara! Block work great!

 

Powered by SMFPacks Social Login Mod