Developer forum

Forum » CMS - Standard features » Page Property - short cut with target setting

Page Property - short cut with target setting

Tan Pang Lin Dynamicweb Employee
Tan Pang Lin
Reply

Dear Support

Our customer would like to redirect one of the page to its's corporate website's page.   But they want it to be opened in a new tab/new window instead of same window which will effectively bring the potential out of its local's website,  reason is for SEO purpose.  

We are teaching them to use the short cut in the page proeperty to do a redirction.  However,  we noted that there is no target setting.   May I know how can I achieve this requirement without too much of programming?

Thanks

Pang Lin

Carrier_short_cut.png

Replies

 
Khine Lwin Myint
Reply

Hi , 

Can I know how we can achieve this requirement?

Regards,

Khine

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Khine,

 

This is how we do it, by changing the xslt to check if the URL starts with the protocol, and if so, we assume it's an external link and open in a new tab as such.

 

<a href="javascript:void(0)">
  <xsl:if test="@Allowclick = 'True'">
    <xsl:attribute name="href">
      <xsl:value-of select="@Href" disable-output-escaping="yes" />
    </xsl:attribute>
    <xsl:if test="starts-with(@Href, 'http')">
      <xsl:attribute name="target">_blank</xsl:attribute>
    </xsl:if>
  </xsl:if>

  ...

</a>

 

Hope that helps.

Nuno Aguiar

Votes for this answer: 1

 

You must be logged in to post in the forum