Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Direct Link to the Preview Mode

Vote:
 

From within the episerver admin, is there a way to generate a 'direct link' to a page's Preview mode?  The 'Toggle preview mode' set to 'On', gives them exactly what they want.

When the author sends a link to some other staff members, it opens for the recipients in 'Edit Mode'.   They simply want a link that automatically opens with the 'Preview Mode' toggled on.

The link generally follows this pattern:
https://edit.domain.com/EPiServer/CMS/?language=en#context=epi.cms.contentdata:///123456&viewsetting=viewlanguage:///en|active:///true

So the end goal is:
"As an author, I want to share a link that opens the 'Preview Mode' toggled on for the recipient so that they can quickly review a draft"

#249159
Feb 24, 2021 16:05
Vote:
 

I don't believe there's any way of getting in the admin currentl.

Programtically you can get the URL by calling PageEdititng.GetEditUrl(reference) so I would suggest adding something in to the admin or in your site when in preview mode. You could just add a bar at the top of your pages with the URL when PageEditing.PageIsInEditMode

#249206
Feb 25, 2021 9:21
Vote:
 

Maybe not the optimal solution, but you could change the default view from edit mode to preview mode using an UI descriptor.

[UIDescriptorRegistration]
public class MyUIDescriptor : UIDescriptor<PageData>
{
    public MyUIDescriptor()
    {
        DefaultView = CmsViewNames.PreviewView;
    }
}
#249208
Feb 25, 2021 9:47
Vote:
 

This might not be the most direct way to answer your question, but check out James Stout's (eGandalf's) Epi.PagePreview:

https://nuget.episerver.com/package/?id=eGandalf.Epi.PagePreview 

https://github.com/egandalf/eGandalf.Epi.PagePreview

This was originally created to address the issue when a non-authenticated user (like a key stakeholder) needs access to preview a page before it is published, since preview is only meant for authenticated users.

#249240
Feb 25, 2021 20:39
Vote:
 

Hey Brandon,  

Havent talked for a while.. Hope things are good on your end!!! 

You may want to look into extending one of the plug-in areas and creating a custom button or menu items and then use javascript to copy that link to the users clip board (or what ever you want to do with the link.

See if this helps you out....

https://world.episerver.com/documentation/developer-guides/CMS/user-interface/plug-in-areas/

#249241
Feb 25, 2021 22:41
Vote:
 

Update to that last comment: See if this takes you close(ish)  to what you are looking for.  Add a Preview Link to the Navigation Pane

#249265
Feb 25, 2021 23:49
Vote:
 

David, thanks!!  That should give us a much better 'flow' for the users. We'll give that a try.

#249288
Feb 26, 2021 14:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.