I thought I had an approach for this but it does not work. My new process is never called. I just need to add an additional querystring to any preview URL that is generated in CM (publish preview, presentation preview, preview site, experience manager) I thought I could just add it to this pipeline.

      <processor type="Sitecore.Pipelines.GetPagePreviewUrl.GetDefaultUrlOptions, Sitecore.Kernel"/>
      <processor type="Sitecore.Pipelines.GetPagePreviewUrl.SetLanguage, Sitecore.Kernel"/>              
      <processor type="Sitecore.Pipelines.GetPagePreviewUrl.GetUrl, Sitecore.Kernel"/>
      <processor type="MyNamespace.MyClass, MyAssembly" patch:source="MyConfig.config"/>      

My class looks like this:

    public class MyClass
        /// <summary>Runs the processor.</summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetPagePreviewUrlArgs args)

However, my new process is never called (not logging, can't attached). I have looked at the showconfigs and it is patched in where I expected it to be (as shown above). Is this not the correct pipeline?

Update Been digging into this and based on what I have found all the previews are command based (would make sense). So to tweak the behavior you need to override the following commands.

    <command name="item:preview" type="Sitecore.Shell.Framework.Commands.PreviewItem,Sitecore.Kernel"/>

    <command name="contenteditor:preview" type="Sitecore.Shell.Framework.Commands.ContentEditor.Preview,Sitecore.Kernel"/>

    <command name="webedit:openexperienceeditor" type="Sitecore.Shell.Applications.WebEdit.Commands.OpenExperienceEditor, Sitecore.ExperienceEditor" patch:source="Sitecore.ExperienceEditor.config"/>

Headed down that road and will update.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.