5

We want to generate and deploy one WAR package for our website, using Experience Manager only on the production/staging environment. So we package all the necessary jars, have the XPM filters configured in web.xml and the correct cd_XXX_conf.xml on the classpath. Is there some central way to disable the XPM filters from kicking in so we can disable XPM on all other envs? I was thinking about:

  1. using a(from servlet 3.0) ServletContainerInitializer to only register the XPM filters when some env-property is set/true
  2. Subclassing the XPM filters and only apply orig logic if some prop set/true

Other ideas?

2 Answers 2

5

What we usually do is take care of having a different configuration for Live vs Staging at the root source, i.e. have a build script (ANT or Maven) that takes different parameters for Prod Live and Prod Staging which yields different WAR files, one with XPM and one without.

If you are adamant on having one WAR file for both that only controls the inclusion of the filters, then customizations as you've suggested are the way to do it. There is no central switch out of the box provided by Tridion for this kind of thing.

However, in the Tridion CM, there is a setting that controls if a publication target has "Enable inline editing": enter image description here

What this means is that the XPM Javascript won't have the necessary XPM settings to function fully. However, you will still need to add logic to your templates to not show the Page Settings script which shows the XPM toggle switch:

enter image description here

<!-- Page Settings: {"PageID":"tcm:10-14906-64","PageModified":"2014-11-02T22:11:45","PageTemplateID":"tcm:10-14703-128","PageTemplateModified":"2014-11-02T22:11:15"} -->
<script type="text/javascript" language="javascript" defer="defer" src="http://localhost:81//WebUI/Editors/SiteEdit/Views/Bootstrap/Bootstrap.aspx?mode=js" id="tridion.siteedit"></script>

This script is either rendered using the out of the box TBBs for a Dreamweaver-based templating solution, or manually via other custom means.

You can determine this in your templates with a TBB function as described here: How to determine if publishing to SiteEditable/XPM-enabled site?

1

There is no setting out of the box in Tridion to disable XPM from kicking. However, it is dependent on specific tags being placed inside the HTMl of the page, and if these tags are not present then you get no XPM. There are many ways to achieve this, and it mostly depends on the situation in your environment.

1
  • Hi Robert, the issue is more that we do not want the overhead of the filters in web.xml being applied on requests in production since this has no use. At the same time we DO want to roll-out only 1 EAR/WAR in our the dev-street, and not create a package specific for production.
    – Para Jaco
    Commented Dec 21, 2014 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.