SOLVED

Guided landing page with dynamic background image

Go to solution
Franky_Ruyssch2
Level 4

In my landing page template I have a div #header2 which has a background image defined with a variable :

#header2{ background-image: url(${header2BackgroundImage});background-position: center;background-repeat: no-repeat;background-size: cover;padding:25px;margin:0;}

The problem is that this background image should be different based on a segment ( coreActivity ) . But I do not see this value in the dynamic content section.

How should I handle this background image problem?

Is there a way to get the URL in the dynamic section?

Franky Ruysschaert
1 ACCEPTED SOLUTION
Grégoire_Miche2
Level 10

It will be difficult because variables cannot be made dynamic.

See and

You will have to use a workaround, such as adding an image element elswhere in your template, make it dynamic, and have some JS that take this image and set it as the background image for your header and hide the element.

-Greg

View solution in original post

15 REPLIES 15