L&L template inside "Query Loop" block

I’m new to L&L and wanted to see if it would work for me inside an existing Query Loop block.

My usecase:
I have a Query Loop Gutenberg block on a custom post type that has an ACF custom field. I want to add a L&L template that can interact on each of the query loop results so that I can change its markup based on the existance/value of the custom field.

Can L&L interact with the Query Loop block in this manner?

Hey Corey! Welcome to the community and great username choice! Hahaha

L&L doesn’t natively work inside other code blocks in Gutenberg, but this kind of use case would be the perfect opportunity to use Tangible Blocks which allows you to build blocks with custom controls using L&L markup.

I know you’ve already applied for the beta program but I thought I’d follow up here for anyone else that comes across this thread and is curious about how to achieve the same thing. I’ve just sent you a DM about getting you onboarded!

Hello, if I understand correctly, when using the plugin, I have to create a template to render the loop content. It won’t use the WP Query block rendering ? Is there any examples ? Or links to help to understand how to achieve this ?

Hi Jean-Michel!
When we say template, we mean the “Tangible Template” block. Normal HTML blocks won’t render dynamic L&L tags, so you have to either use the inline editor in the block we provide or create a template (under the Tangible menu item in the admin) and load in that existing template using our block

See @benjamin’s post “An absolute beginner’s guide to L&L” for more information on how to use templates

OK, I understand now what you call Template. So, it’s styling I need. I had to practice CSS and SASS or can I “grab” somewhere the style of the theme for Query Block ?

Anything that doesn’t have styling applied by your theme will look a little ugly. If you use a heading tag or a link your theme will probably apply some default styling, and you can look for existing styling and markup for things like buttons, post tags or other metadata on your theme templates to try to piggyback off of that styling instead of creating your own. At the end of the day, though, if you start using L&L widely on your site builds you’re going to have to get the hang of CSS :slight_smile:

It will be only on posts in the loop as I try to hide featured image on a site with unique content for members and the content are images. I will make some tests to see how it shows. Thanks for your answers.

1 Like