Announcement

Collapse
No announcement yet.

Get Current url with Variable

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

    Get Current url with Variable

    Hi,

    im trying to add the canoninical tag to my website and to do this I need to get the current page url so if im on "about us" display "http://www.store.com/acatalog/about_us.html" in the layout.

    does anyone have any ideas on how to put the current page url into the layout using a variable of some sort?

    Thanks,
    Simon
    www.simonstaton.co.uk

    #2
    Originally posted by SpecTech View Post
    Hi,

    im trying to add the canoninical tag to my website and to do this I need to get the current page url so if im on "about us" display "http://www.store.com/acatalog/about_us.html" in the layout.

    does anyone have any ideas on how to put the current page url into the layout using a variable of some sort?

    Thanks,
    Simon
    The variable CatalogURL gives the details up to the last / in the URL if you add the SectionPageName variable to it you will have the current URL.

    Code:
     <actinic:variable name="CatalogURL" /><actinic:variable name="SectionPageName" />
    This only works if you have setup the domain details in Network Settings

    Malcolm

    SellerDeck Accredited Partner,
    SellerDeck 2016 Extensions, and
    Custom Packages

    Comment


      #3
      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%27Brochure%27" >
      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsBrochureHomePage%22%20%2f%3e" >
      <link rel="canonical" href="<actinic:variable name="WebSiteURL" />" />	
      </actinic:block>	
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%27Brochure%27" >
      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsBrochureHomePage%22%20%2f%3e%20%3d%3d%20false">
      <link rel="canonical" href="<actinic:variable name="CatalogURL" /><actinic:variable name="BrochurePageURL" />" />
      </actinic:block>
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Section%22" >
      	<link rel="canonical" href="<actinic:variable name="CatalogURL" /><actinic:variable name="SectionPageName" />" />
      </actinic:block>
      You will get the odd spurious error red box which will appear then dissappear (TheIsBrochureHomePageVariable has been placed etc etc....)

      Have fun!
      Jonathan Chappell
      Website Designer
      SellerDeck Website Designer
      Actinic to SellerDeck upgrades
      Graphicz Limited - www.graphicz.co.uk

      Comment


        #4
        Hi There I am trying to something similar with a 'add page to favourites' script,
        Using single product per page, I need the url of the product page in a variable.
        does anyone know of a way of doing this?
        the Page Title bit is Easy, but the product page URL has got me stumped!
        below is the line of script i need to get right..


        <a href="javascript:bookmarksite(' Page Title', 'product page url')">Add to <br />Favourites!</a>
        Tezzflyer

        Websparky Electrical Goods

        http://www.websparky.co.uk

        Comment


          #5
          I think it's this - perhaps someone can check?

          Code:
          <script language='JavaScript'>
          
          function addbookmark()
          {
          bookmarkurl='http://www.yourdomain.com'
          bookmarktitle='Your domain'
          if (document.all)
          window.external.AddFavorite(bookmarkurl,bookmarktitle)
          }
              </script>
          Jonathan Chappell
          Website Designer
          SellerDeck Website Designer
          Actinic to SellerDeck upgrades
          Graphicz Limited - www.graphicz.co.uk

          Comment


            #6
            Terry,

            Already answered in your V11 thread.

            It's best not to double post as it annoys key contributors.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X