I assume its the itemStyle.xsl that I need to customize, but what is the code to add a "new Item Link to the bottom of a Content Query Web Part that takes you to the modalDialog for a new list item?
Bismarck
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI assume its the itemStyle.xsl that I need to customize, but what is the code to add a "new Item Link to the bottom of a Content Query Web Part that takes you to the modalDialog for a new list item?
Bismarck
The CQWP is tricky because it might roll-up content from multiple sites, sub-sites and lists, which practically means that items could be mixed comming from different lists, therefore your URL will change everytime. The obvious question will be - New item to be added into which list, under which site?
Cannot deliver full code but - link to the NewForm.aspx - for which you need to know the URL of the item to deduct the ListItem or at least you would need the List Id
function Opendialog() {
var options = SP.UI.$create_DialogOptions();
options.resizable = 1;
options.scroll = 1;
options.url = YourSiteURL + "/_layouts/listform.aspx?PageType=8&ListId={PUT-LIST-GUID-HERE}";
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
SP.UI.ModalDialog.showModalDialog(options);
}