Score:0

Image fields that vary by theme

de flag

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.

4uk4 avatar
cn flag
You could add a theme select field to the paragraph and then show the image only if it matches the current theme.
Geat avatar
de flag
@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.
4uk4 avatar
cn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.