Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Pre-publish checklist View modes: 
User avatar
Member
Member
danielrae - 6/10/2011 7:40:53 AM
   
Pre-publish checklist
I've had a thought about publsihing content and was wondering if it would be possible.

We have created documentation, in the form of a checklist, for publishing news stories, blog posts and general pages.

Basically, any content editor who publishes new or edited content should make sure they adhere to these checklists. They should not be publishing content that doesn't meet the criteria.

Do you think there could be any way to integrate these checklists with Kentico itself. For example, when somone hits publish, they see an "are you sure" popup asking them to double check that their content meets criteria?

This would have to be customisable for different document types, so that you could have a different message for news, blogs, general pages, events, etc.


User avatar
Member
Member
kentico_michal - 6/12/2011 4:44:02 AM
   
RE:Pre-publish checklist
Hello Daniel,

Regrettably, this is currently not supported. In order to display some kind of popup window you will need to modify the ReloadMenu() method in the following file: ~\CMSModules\Content\Controls\EditMenu.ascx.cs. In the code you can get the current document and display popup window based on the NodeClassName when the button Publish is clicked.

So, for example, you could use the following code:

ORIGINAL CODE (line 819):

approveItem.JavascriptCommand = FunctionsPrefix + "Approve(" + NodeID + ");";



NEW CODE:

CMS.TreeEngine.TreeNode node = null;
UserInfo ui = UserInfoProvider.GetUserInfo("administrator");
CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider(ui);
node = tree.SelectSingleNode(NodeID);

if (node.NodeClassName == "CMS.News")
{
approveItem.JavascriptCommand = "if(confirm('CMS.News - Are you sure everything is correct?')== false) return false;" + FunctionsPrefix + "Approve(" + NodeID + ");";
}
else if (node.NodeClassName == "CMS.Article")
{
approveItem.JavascriptCommand = "if(confirm('CMS.Article - Are you sure everything is correct?')== false) return false;" + FunctionsPrefix + "Approve(" + NodeID + ");";
}
else
{
approveItem.JavascriptCommand = FunctionsPrefix + "Approve(" + NodeID + ");";
}


This code should ensure displaying two different popup windows based on the ClassName of the current document (CMS.News vs CMS.Article).

Best regards,
Michal Legen

User avatar
Member
Member
danielrae - 6/13/2011 4:18:51 AM
   
RE:Pre-publish checklist
Thanks very much for the detailed solution!