Forum

Thread tagged as: Question

target="_blank"

I have a simple syntax question. How do I insert target="_blank" into a template URL?

Ex:

<a href="<perch:content id="url" type="text" label="URL" />"> 

Where does it go here?

kyle cadotte

kyle cadotte 0 points

  • 3 years ago
Simon Clay

Simon Clay 127 points

Hi Kyle, it's not part of the Perch tag as such, so you'd do it like this...

<a href="<perch:content id="url" type="text" label="URL" />" target="_blank"> 

Thank you.

We do something like this (simplified a little to display here), to let the page editor decide if the link is a new window/tab or not ...

<a href="<perch:content id="link" type="text" label="Optional page/website link" required="false" title="true" size="l" order="3" />" target="<perch:content id="newtab" type="select" options="This tab/window|_self,New tab/window|_blank" label="Open the link in ...?" order="4" />"><img src="<perch:content type="image" id="image" label="Image" width="200" order="1" />" alt="<perch:content id="alt" type="text" label="Image Text" required="false" title="true" size="l" order="2" />" /></a>