Make Web preview default for some groups

Build 1501 on 14/Nov/2017  This topic last edited on: 24/Oct/2016, at 12:24

The default preview on the Articles main tab is always WYSIWYG, but you can make the Web preview default as well, based on the group settings.

 

To make the Web preview default for some groups

1.Add a custom parameter PreviewType to the group(s) that needs to get the web preview, and specify in it the value of the full path to the publishing destination you want to preview.

2.Add a custom OnArticleOpen function in the CustomArticle.vb, and then interrogate it for the above parameter, e.g. and then run, when necessary, WebPreview (dest) where the 'dest' is the value of the parameter.

Example of the code

Dim context As LoginContext = EditorialLogin.GetLogin.GetContextObj()

Dim sPreview As String = context.GetParam("PreviewType")  

' returns name or Nothing - if parameter with specified name not found 

if not spreview is nothing then

 WebPreview(spreview) 

end if