We are building a website that has multiple themes that can be applied to it, based on user selection.

The page content type is made up of Paragraphs (from the paragraph module), each of which can have a background image via an Image field.

Sometimes it is necessary to have these background images vary by theme. Is there an existing way to allow a different image to be added to a node per theme? Obviously this can be achieved through each theme's CSS, but it would be great to expose the functionality to the site editor rather than making it a development task.

  • You could add a theme select field to the paragraph and then show the image only if it matches the current theme.
    – 4k4
    Dec 22 '21 at 17:20
  • @4k4 As there are multiple paragraphs that have these images, ideally the logic will be handled by the image field (or equivalent) itself, as this way would require either a paragraph that contains a select and an image, or a custom compound field.
    – Geat
    Dec 22 '21 at 17:32
  • 1
    or a media image type with an additional field. This depends on which level you want to share the background image and its connection to a theme. Media can be shared in contrast to paragraphs or compound fields.
    – 4k4
    Dec 22 '21 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.