I'm trying to replace code within the body of an article depending on whether it is the AMP version or not.

For example, an article with an embedded image that begins with

  • What is the relation with ExpressionEngine ??
    – Stéphane
    Jan 14, 2020 at 3:54
  • The CMS is ExpressionEngine. The body of the article exists in the body field, which also contains the embedded image. I would like to be able to switch img to amp-img depending on whether the url as an amp segment or not. Jan 15, 2020 at 20:45

1 Answer 1


There's no native way of doing this as far as I know so you'd probably need to do this programmatically via a custom addon that rewrites IMG tag based on the URL segment.

This is a classic case where using a fluid fieldtype for "body" content is useful, that would make swapping IMG tags based on URL segment a piece of cake!


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.