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 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. – Scott S. Bateman Jan 15 at 20:45

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

