Adobe Tech Blog
Published in

Adobe Tech Blog

MSM/Live Copy : Rewrite Reference Links Inside Experience Fragments or Template Structure Content

The problem

Have you ever experienced this problem? Whenever you create a live copy/roll-out a master page, all the reference links inside a page get updated to the live copy equivalent links automatically; however, this is applicable only for the links which are stored inside a component property or page property in a page. If there are links referenced in editable template structure content or inside an experience fragment, which is used in a master page, it won’t be updated to the live copy equivalent link on roll-out. This is because these are shared or global content, which will be stored in one location (“/conf” or “/content/experience-fragments”).

The solution

Here is the solution: Use a custom “Link Transformer” to rewrite master links into live copy equivalent links.

The steps to implement a custom Link Transformer

Create a Transformer Factory

Create the Transformer Class

  1. In the init method, get the current resource or page.
  2. Check if the current page is a live copy or part of the live copy site.
  3. If the current page is live copy, get the blueprint path (“/content/path/to/master-site”) and get the live copy path (“/content/path/to/livecopy-site”).
  4. In the “startElement” method of the transformer, get the anchor link and replace the “/content/path/to/master-site” with “/content/path/to/livecopy-site”.

Add the transformer config

  1. Add the config node to /apps/<project>/config/rewriter

2. Include the transformer type and don’t forget to include the linkchecker (default OOTB transformer).

3. Specify the resource type which will be the page component resource type.

4. Specify the content paths for which the transformer is applicable.

Key notes

  1. The solution is applicable for one level of live copy. This can be modified to get all the blueprint paths recursively, and the same can be used to replace the links.
  2. The solution is applicable only for anchor links. This can be modified to check for any other HTML tags or attributes, where a page link can be expected.


  1. Sling Rewriter —
  2. Live Relationship Manager API —

Any suggestions or questions? Please feel free to comment.




News, updates, and thoughts related to Adobe, developers, and technology.

Recommended from Medium

Fixing storysnap test errors when including react-konva components in storybook

MQTT broker with Secure WebSocket using Traefik, Docker Compose and Let’s Encrypt

Binary search and two pointer

Gatsby JS: Build a static website with React

Programmer speed paranoid meme: from reddit

Iterators in Javascript

An Intro to TypeScript and React

From nothing to 5 decent leads a week as a freelancer

Box Model in CSS: “Boxes — Rectangular Boxes Everywhere 😅”

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sreenivas B

Sreenivas B

Senior Technical Consultant | AEM

More from Medium

The Path to Great Relationships Part #4. Technical Writer and Project Manager

YouTube’s Information Architecture

A screenshot of YouTube, highlighting the Subscriptions and Watch later options that are listed along the left-hand navigation menu.

Supporting Large-Scale Digital Signage Deployments

Digital signage management focuses Player directional communication, zero-config operations and scaling of number of Players.

Design Retrospective: Art Clock

The finished Art Clock displayed on a horizontal tablet sitting on a light wood shelf with books to the right and a Christmas cactus to the left. The Art Clock shows a close cropped etching of a medieval figure with the minute hand pointed to their chin (at 30 past the hour) and the hour hand a 1pm, corresponding to the angle of the figure’s eyes.