06 September, 2023

Hacky way to open XM Cloud Pages App from Content Editor using Sitecore PowerShell

When a content author is using Content Editor and want to use Pages to edit the pages, author can go to XM Cloud Apps Dashboard and then open the Pages App and then navigate to the appropriate item in the tree. In order to minimize the steps for the content authors, a simple hack in the content editor can help content author to open the Pages with appropriate item directly by click of a link. 

A page with Layout will have option to open it in Pages by clicking here hyperlink.

Sitecore PowerShell Extension is again helping here to set it up. Thanks to Adam Najmanowicz | @adamnaj / Michael West | @michaelwest101 for their effort to develop and release SPE for the community. 

  1. Create a new Module with Content Editor Warning integration point
  2. Go to the module and find Warning script library under Content Editor Warning item
  3. Create new PowerShell Script under that item and name it as Pages.
  4. Add the script with the below code.

Script to enable this feature:

In order to enable this feature only to the items where page layout is present, in the Enable Rule field, add ''where the item has a layout' rule. 

That's it. 

Points to remember:
  • This hacky will enable this option for all the pages where layout is present. In case if your use case is complex, then appropriate rule should be applied. 
  • The Pages link will open in another tab of the same browser. It is assumed that user is logged in to Sitecore Cloud Portal so that pages will automatically login and redirect to the selected item. 
  • Remember - This may not work for some complex Site grouping (have not tested it) but hoping Sitecore to add similar feature to open Pages from Content Editor out of the box 😊

No comments:

Post a Comment

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }