Announcement

Collapse
No announcement yet.

Removing the anchor tag from the product link in the search results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Removing the anchor tag from the product link in the search results

    Hello friendly forum folk,

    I wonder if anyone could tell me where in the tangle of Perl I might be able to find and edit the product link that appears in the search results as I would very much like to remove the anchor tag (i.e. #aproductref) from the end of the link.

    The reason I would like to do this is that when a product page is accessed via following its link in the search results, the anchor tag in the link prevents the passing of the page title / product name through to a 'tell a friend' PHP script I have linked on the product page. If I manually remove the '#whatever' from the URL in the address bar then the title is passed through correctly.

    Can anyone help? Hope so.

    Many thanks.

    Angi
    OXLink Web Design (Oxford)
    Actinic developers since version 3
    01865 361696

    #2
    That anchor tag is quite useful, especially on longer pages. It might be better to modify the "Tell a friend" patch. If you post the URL of a problem page I'll have a look.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks very much for your reply Norman, but the anchor tag doesn't actually have a purpose in the case of this site as there is just one product per page.

      The site isn't live yet (the customer is currently adding in products - so I'm not sure what state it's in at the moment!).

      You can go to: http://www.definitelybaby.com/index.html though and use the search facility.

      Search for the word 'woven' then follow the product link and try to use the tell a friend feature. The resulting page will not include the name of the product. If you remove the '#aTPP012' part of the URL in the address bar though and hit return on that page, it does work.
      OXLink Web Design (Oxford)
      Actinic developers since version 3
      01865 361696

      Comment


        #4
        In your Act_Primary.html you have
        Code:
        <script language="javascript" type="text/javascript">
        function winrefer(u){
        window.location.href=u+'?httpreferer='+document.URL+'&title='+"Woven drawstring tunic";
        }
        try changing it to
        Code:
        <script language="javascript" type="text/javascript">
        function winrefer(u){
        window.location.href=u+'?httpreferer='+document.URL.replace(/#.*$/,'')+'&title='+"Woven drawstring tunic";
        }
        as this will strip the anchors # and anything that follows from the URL before submitting it.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Norman, you are a star!

          Many thanks Norman, that's just the job! I've only tested it on a local copy of the site at time of writing but it certainly appears to do what I'm looking for, so I've sent the amended primary template on to the client and hope to see it working in 'real life' shortly too.

          Thank you once again for you prompt and extremely helpful reply.

          Angi
          OXLink Web Design (Oxford)
          Actinic developers since version 3
          01865 361696

          Comment


            #6
            Glad it worked (especially as I just typed the JavaScript in without checking it).

            It's a more controllable solution that patching the Perl as the scripts get replaced whenever you upgrade Actinic to a new patch release, and you'd have to re-patch.

            Template mods, however, will be preserved OK through up upgrades.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X