Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Location
    San Diego
    Posts
    159
    Plugin Contributions
    0

    Default External Link in Product Description

    Hi:
    I would like to add an external link to the text on a product description page to link to an album on another site.
    How would I add the link?
    Thanx in advance
    Rufus in Del Mar CA

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,872
    Plugin Contributions
    96

    Default Re: External Link in Product Description

    Assuming that you want to link to http://zen-cart.com, you'd add the following:
    Code:
    <a href="//zen-cart.com" target="_blank">Zen Cart!</a>
    Omitting the http: from the link makes it so that you won't get "mixed content" (i.e. http:// content on an https:// page) and the target="_blank" opens the page in a new window.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: External Link in Product Description

    Quote Originally Posted by lat9 View Post
    Assuming that you want to link to http://zen-cart.com, you'd add the following:
    Code:
    <a href="//zen-cart.com" target="_blank">Zen Cart!</a>
    Omitting the http: from the link makes it so that you won't get "mixed content" (i.e. http:// content on an https:// page) and the target="_blank" opens the page in a new window.
    Important thing to note as lat9 eluded, is if the destination supports the https: and http: call as applicable for the page displaying the link.

    Couldn't the product url field on the product information page also be used? (Assuming 1) that is an acceptable solution by the OP, 2) the template properly supports it, and 3) display of that field is on for the product type.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: External Link in Product Description

    Quote Originally Posted by lat9 View Post
    Assuming that you want to link to http://zen-cart.com, you'd add the following:
    Code:
    <a href="//zen-cart.com" target="_blank">Zen Cart!</a>
    Omitting the http: from the link makes it so that you won't get "mixed content" (i.e. http:// content on an https:// page) and the target="_blank" opens the page in a new window.
    Mind if I add my 2cents worth? Too bad <g>

    If it is known that external link supports SSL, then it is better to explicitly define it in the href rather than using the protocol-agnostic link as you've described.

    EG:
    Code:
    <a href="https://zen-cart.com" target="_blank">Zen Cart!</a>
    rather than
    Code:
    <a href="//zen-cart.com" target="_blank">Zen Cart!</a>
    However, if the link is included in a page that will never be used with SSL, then it is better to use
    Code:
    <a href="http://zen-cart.com" target="_blank">Zen Cart!</a>
    The protocol agnostic links should be a 'last resort' rather than a 'front line' method.

    For the coders amongst us, the protocol agnostic links are much like a 'loosely/weakly typed' language vs a 'Strongly typed' language.

    It works most of the time, but it can also have unexpected and unwanted behaviour.

    Where possible it pays to be explicit.

    Cheers
    RodG

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,872
    Plugin Contributions
    96

    Default Re: External Link in Product Description

    RodG, good advice (as always). Thanks for the clarification.

 

 

Similar Threads

  1. External Link Opens Internal - Not External - Page
    By missTish! in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Apr 2011, 01:18 AM
  2. load product description from external site
    By balihr in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 21 Dec 2009, 06:55 AM
  3. Replace the normal digital product download link with a different/external link
    By ballyc27 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 1 Jul 2009, 05:31 PM
  4. External Image link and description formating
    By ccn1 in forum General Questions
    Replies: 0
    Last Post: 6 Apr 2009, 11:25 AM
  5. External Link within Products Description
    By gabstero in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Jan 2008, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg