New deployment is removing all styling | AEM

After the deployment of a pipeline on a specific environment in Adobe Experience Manager, custom styles were removed from a template, resulting in the loss of styles from the related page. Please remember to set the filter mode to merge.

Description description

Environment

Adobe Experience Manager (AEM)

Issue

After deploying a pipeline on one environment, the custom styles from a template, and as a consequence, the styles from the page created with that template, were removed.

Figure 1. The template with the styles present.

Figure 2. The template without the styles.

Resolution resolution

When the project that was deployed in their environment was reviewed, the filter.xml file under the branch that was in charge of changing the content—in this example, [ 1] —contained the filters [ 2] .
The modified template after the deployment was located at /conf/path>/settings/wcm/templates/modified template>, but it had no filter mode, which by default indicates replace.
This implies that anytime a pipeline is deployed, the path in the code will be used instead.
This has to be fixed by setting the filter mode to merge like it is for the other paths [ 3] .

[ 1]

/aem-<cust>-project.all-0.0.1-SNAPSHOT/jcr_root/apps/<cust>-packages/content/install/aem-<cust>-project.ui.content-0.0.1-SNAPSHOT/META-INF/vault/filter.xml

[ 2]

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/conf/<path>/settings/wcm/templates/<modified_template>"/>
    <filter root="/conf/<path>" mode="merge"/>
    <filter root="/conf/<path2>" mode="merge"/>
    <filter root="/content/<path2>" mode="merge"/>
    <filter root="/content/dam/<path2>/asset.jpg" mode="merge"/>
    <filter root="/content/experience-fragments/<path2>" mode="merge"/>
</workspaceFilter>

[ 3]

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/conf/<path>/settings/wcm/templates/<modified_template>" mode="merge"/>
    <filter root="/conf/<path>" mode="merge"/>
    <filter root="/conf/<path2>" mode="merge"/>
    <filter root="/content/<path2>" mode="merge"/>
    <filter root="/content/dam/<path2>/asset.jpg" mode="merge"/>
    <filter root="/content/experience-fragments/<path2>" mode="merge"/>
</workspaceFilter>
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f