1.
Its actually pretty easy to do this, first you'll need a template set up in ContentQueryMain.xsl. Search for the OuterTemplate.GetSafeLink, and copy and paste it right below. Now all you'll need to do is ofc change the name of the template, I just named it OuterTemplate.GetEditLink:
<xsl:template name="OuterTemplate.GetEditLink"> <xsl:param name="UrlColumnName"> <xsl:if test="$UseCopyUtil = 'True'"> <xsl:value-of select="concat($RootSiteRef,'/_layouts/CopyUtil.aspx?Use=id&Action=editform&ItemId=',@ID,'&ListId=',@ListId,'&WebId=',@WebId,'&SiteId=',$SiteId,'&Source=',$Source)"> </xsl:value-of> </xsl:if> <xsl:if test="$UseCopyUtil != 'True'"> <xsl:call-template name="OuterTemplate.GetSafeStaticUrl"> <xsl:with-param name="UrlColumnName" select="$UrlColumnName"> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:param> </xsl:template>
The only change made to template other than the name is the Action=, changed to editform, that's it.
2.
Now for using it in a CQWP you'll need to set up an ItemStyle to use it. Make a variable to use the new template.
<xsl:variable name="SafeLinkEditUrl">
<xsl:call-template name="OuterTemplate.GetEditLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
3.
And then its set to use with xsl:value-of.
<a href="" title="{@LinkToolTip}"
onmouseover="javascript:this.style.cursor='hand';"
onclick="javascript:SP.UI.ModalDialog.ShowPopupDialog('{$SafeLinkEditUrl}');return false;">
<xsl:value-of select="$DisplayTitle"/>
</a>
No comments:
Post a Comment