I have a blog and I want to dynamically insert some repeating groups (city names in a card format I already have in the db) in the middle of the blog or at the end. I thought of two options:
When I create the blog post from my blog dashboard, I create a dropdown field with all my cities and select the right city for the blog post from there. But then how do I bind the filter with that repeating group specifically?
I setup a rule in the repeating group to look for keyword(s)in the title of the page or something like that without any inputs.
Is there a better way to do it? I’m using HTML blocks from a plugin on my blog.
Hey @adig If you’re trying to drop a dynamic RG into the middle of a blog post, the easiest setup is usually to link the blog post to a City field directly in the database and let the RG read from that.
A simple way to do it:
Add a City field to your Blog Post data type
Instead of parsing keywords or titles, just store the city directly when you create the post.
In your blog page, pull the RG’s data from “Current Page Blog Post’s City”
Your RG can just search for cities = Current Page’s City (or whatever structure you use).
No need for dropdown filtering on the frontend — Bubble will load the correct group automatically.
If you need the RG inside HTML content
HTML blocks can’t host Bubble elements, so you’ll want to place the RG normally on the page and show/hide it based on markers in your blog content, or render blog sections separately.
Most people solve this by splitting the blog content into sections (e.g., paragraph → RG → paragraph) instead of trying to render the RG inside the HTML plugin.
If you share a bit more about how your blog content is structured (single HTML field vs multiple fields), I can point you to a cleaner approach.
Thanks a lot @connect10 . That makes sense. In terms of how to show it, I was thinking to do HTML block. then my RG, the HTML block and so on. What do you think?
If you plan to reuse RG elsewhere, use a Reusable component that handles design and shows the content.
You can use Properties to customize or filter content then. And the same Reusable can display different content depending on properties(even dynamic expressions) and the desired places.
great idea. so are you saying that I can setup those cards as a reusable DYNAMIC component so it automatically takes some context and shows teh right thing? (cities). How would I make it show that? Cheers
Yes, you can customize Reusables with your own properties and, depending on the values, display different content.
Please read this section Reusable Elements | Bubble Docs