Developer forum

Forum » Templates » ParagraphImageLinkTarget is not working

ParagraphImageLinkTarget is not working

Martin Nonbo Jensen
Reply
Hi all.

On our company website I have a slider which is controlled by a paragraph. The paragraph look as following:
<a href="<!--@ParagraphImageLinkClean-->" target="<!--@ParagraphImageLinkTarget-->" > 
<img src="<!--@ParagraphImageClean-->"  alt="<!--@ParagraphImageLinkAlt-->" 
title="#slide_<!--@ParapgraphContainerSort-->" /></a>
<div id="slide_<!--@ParapgraphContainerSort-->" class="nivo-html-caption"><!--@ParagraphText--></div>

The problem is in my ParagraphImageLinkTarget. I cannot get it to work properly. No matter what I apply in the
Image link target, is it opened in a new window. When I look at the source code it looks like this:
<a href="..." target=">. Does anyone have a solution to this?

ALSO, i have searched the DW sites for some information on how to use if statements. I would like the link tag
to be removed, if there is not defined a link on the paragraph image. Right now it will just link to the front 
page. Does anyone know where I can find some information?

You can se the solution here: www.kompagniet.com. The slider is on the frontpage (Forside)

Hope someone can help me?

Kind regards 
Martin Nonbo

Replies

 
Regin Madsen
Reply
 Hi Martin,

Try and remove the target. If you just want to open it in "_self" theres no need, and if you leave it empty it will by default open in a new window/tab.

Regarding the If - what youre looking for is If Defined

<!--@If Defined(MyDWTag)-->
Do something
<!--@EndIf(MyDwTag)--> 

 
Martin Nonbo Jensen
Reply
Hi Regin.

Thank you for the help with If Defined. It works like a charm :-)

The problem with the link target is that I want some of the links to open in a new window and some of them to open in same. And even when i apply target="_self" to the links, it opens ind a new window...? 
 
Regin Madsen
Reply
If the "target" is set from the backend, you should be able to get it through tags, and hence use another ifdefined there...then simply drop the target unless its set, or even use a if statement instead where taget tag is equal to _parent (or so)

/Regin Madsen, e-kompagniet
 
Martin Nonbo Jensen
Reply
 That sounds like a solution. I will try that, thank you very much!

 

You must be logged in to post in the forum