New item link in pop-up window
New item link for Content Query Web Part to open in popup window
This is a part of Xslt of Main
plusIcon.png and MyStyle.css is uploaded to /Style library/MyFolder
<xsl:template match="/">
<link rel="stylesheet" type="text/css" href="/Style library/MyFolder/MyStyle.css"/>
<h2>Aktuality</h2>
<xsl:call-template name="OuterTemplate" />
<!--'New Item' for current list-->
<xsl:variable name="ListId">
<xsl:value-of select="dsQueryResponse/Rows/Row/@ListId" />
</xsl:variable>
<xsl:variable name="newItemLink">
<xsl:value-of select="concat('/_layouts/listform.aspx?PageType=8&ListId={', $ListId, '}&RootFolder=')"/>
</xsl:variable>
<!--New item link-->
<xsl:variable name="onclickValue">SP.UI.ModalDialog.showModalDialog({url: '/_layouts/listform.aspx?PageType=8&ListId={<xsl:value-of select="$ListId"/>}&RootFolder=', title: 'New Item', allowMaximize: true,showClose: true});return false;</xsl:variable>
<div class="addNewItemLink">
<img src="/style library/myfolder/plusIcon.png" />
<a id="idHomePageNewAnnouncement" class="ms-addnew" target="_self">
<xsl:attribute name="onclick">
<xsl:value-of select="$onclickValue"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="$newItemLink"/>
</xsl:attribute>
Add new item
</a>
</div>
</xsl:template>