How to build a blog

Hi, does anyone know best practice to build a blog/help page as part of their bubble project? It would basically just be a page with links to different articles. Is it best to set it up with blogs as data types? and how would you structure the url?

2 Likes

No doubt there are plenty of different ways to approach blogs on Bubble…

But the Way I do things is to have 2 datatypes:

“Blog_Post” and “Blog_Section”

A Blog_Post is made up of Blog_Sections, and each section can contain a heading, an image, or some text.

I have a page for creating blog posts and blog sections, and a page for displaying blog posts (using a RG to display the current page Blog_Post’s Sections).

And a blog listing page, to display blog posts.

As for the URL, I generally call my blog post pages “blog-post” so the URL is mysite.com/blog-post/slug

And the blog listing page is called “blog” so the URL is mysite.com/blog

If you really want to you can have the blog listing and blog posts all on the same page, and just use conditionals based on the URL to show either the blog listing or a specific blog post.

4 Likes

Awesome thanks @adamhholmes ! If you make the blog section text within the DB and then dynamically represent it in blog page are you able to do rich text or something like that in order to put links and stuff in the text? Or titles and stuff in different fonts/bold?

Yes, you can use rich text for the body of your posts…

1 Like

How do you do that? When I put the body in the database there is not rich text editor and if I am referring to the body dynamically in the blog post page how would I make the body text have unique rich text per post if they are all referring to different DB entries?

You can’t edit rich text directly in the Bubble datatab… you can only add BBCode…

So use a rich text input on your app when creating your blog posts… the rich text is stored in the DB and will be displayed correctly in your text elements.

2 Likes

Hi @adamhholmes , can you post a screenshot or two of how you have set up your database? I’m looking at implementing a solution like yours, but would be curious to see how you’ve set up your DB?

Thank you,
Dan

1 Like

Sure, it’s pretty simple… and I use a few variations of the same concept on different projects, but here’s one example from one of my live projects:

Blog Post DB

Blog Section DB

image

We also have separate datatypes related to blog posts for FAQ and Article Schema Markup data on posts where it’s relevant.

4 Likes