Dynamic background image for group

I am trying to get an image to ‘fill’ not stretch. I found someone mentioned you could gt around this by using a group with a dynamic background image defined in the style.

I’m building a recipe list and want a large image that will fill and fit a wide image block at the top of the listing. Trying to build this, I can’t figure out how to access the data I’ve passed to the page when defining the group style for the dynamic background image.

Thanks so much!
-Chris

I was expecting to see ‘page data’ or ‘Current recipe’ so I could write something like: ‘Curren’t Recipe’s image’

You have to use "Do a search for"or if you have a reference in your database you can use Current User >> Recipe.

Hi Ualdir, thanks for the reply. Neither of those options are working for me.

*Note: I am not using a logged in User for this page.

I do have recipes in the database with an image and name. I am passing the recipe to the page and using that data to show the recipe name successfully. I can get the image to render onto the page using a standard image and using the dynamic image expression: “Current Page recipe’s image” That works great. But I am having trouble doing the same thing for a group background image using the style editor.

Here I have ‘Search for recipe’ but I can’t access the pages recipe image. The expression is red and no good options are available.

I also tried ‘Current User’ but there is no option for ‘Recipe’ in the dropdown list.

Thanks for your help. I think I don’t understand the difference between how a STYLE can access the page data object but a standard image ‘dynamic image’ can.

Unless Bubble has made some changes I am unaware of, you cannot access Page Level data from the Styles tab. So for the ‘image group’ you can just put a group on the page and style it there. The dynamic expression is then simple like you mentioned: “Current Page Recipe’s Image”

1 Like