[Resolved] Add background image to top level container

Home Forums Support [Resolved] Add background image to top level container

Home Forums Support Add background image to top level container

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2287506
    Brian

    Hi I am working on a new layout using query loops
    https://sluggerotoole.com/home/

    You see the top part in red, I would like to set the featured image as the background image for that section. This kind of thing
    07.19.2022-15.51.54

    The issue is when I set dynamic data is does not work. I suspect the issue is because I am trying to set it on this container which is above the query loop?
    07.19.2022-15.53.34

    If I set it on post template container it works fine but it only shows in the middle container, I would like it to stretch the whole red area like the first screenshot
    07.19.2022-15.55.18

    I know I can manually choose a post to pull the image from but I want to automatic it show the lastest post featured image.

    Any suggestions?

    Thanks

    #2287557
    David
    Staff
    Customer Support

    If that section is to be the Latest Post then you would need to add 2 x query loops.
    The first one should have just 1 post with your featured image background set on the Container.

    Then your other query loop will be as is with an Offset Parameter of 1 so it skips the first post.

    #2287660
    Brian

    Thanks David, i get the concept but it does not seem to be working.

    I applied the background to this container
    07.19.2022-18.28.12

    Does that look right to you?

    #2287716
    Ying
    Staff
    Customer Support

    I don’t think you are supposed to add a query loop block into another query loop block.

    #2287724
    Brian

    I think i nearly have it, this seems to work
    07.19.2022-19.43.59

    But does it look a little overkill?

    One last issue is I can’t seem to get an option to set inner container to restricted, so the content is to the left.
    https://sluggerotoole.com/home/

    I can add padding to the text, but I think I am missing something obvious.

    #2287790
    Brian

    I decided just to go with a fixed container so I will close this.

    Thanks

    #2288175
    David
    Staff
    Customer Support

    Just to cover, the issue you were having above is you had a Query Loop inside another query loop, and thats not supported today, in the future it will allow nested loops, for example loop for the Category terms and under each term show a list of posts.

    For your need it would require 2 x Query Loops, both of which are separate so in the list view they would both be at the root level:

    2022-07-20_09-55-14

    But if you’re happy with your current solution then that is great 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.