View Item Link on a SharePoint content query webpart

In standard the link in the content query webpart links directly to the view form of the selected list. If you want to open the link in the dialog framework popup just add the following click event to the link element in the xsl template of your itemstyle.xsl

<a onclick="OpenPopUpPage(this.href, RefreshPage);return false;" href="{$SafeLinkUrl}" title="{@LinkToolTip}"> Some Link Text</a>

You can leave out the second argument, but if you set it to "RefreshPage" function, the page is refreshed if someone has edited the item.

Of course, you can use this function everywhere and not only in the content query webpart if you have the link to the list item in the href attribute.

Comments

Popular posts from this blog

SharePoint Web Folders - Create a Desktop Shortcut to a SharePoint library on Windows XP with and without SSL

Ways to redirect http requests in SharePoint

Open SharePoint 2010/2013 Display, Edit, New Forms in Modal Dialogs