Challenges in Formatting Text

Hey,

Here’s a screenshot for reference, and in this case, I’m not entirely sure how to edit “current page’s blog’s content.” This field contains headings mixed with regular text (knowing the number of headings, I could potentially create RP or a couple of regular groups), but because each blog contains a different number of titles, I’m just clueless about how to do this while maintaining an overall beautiful structure.

For example, I want my headings to be underlined and bold, while the text remains without underlining and in regular style. If I put everything in RG, then all elements will be in the same style.

What should I do in this case?

Repeating groups inside repeating groups?

Hey, can you kindly explain it a bit furt6what you want to do.

Do want to edit a specific RG item or you are concerned how its visible on page load

The text “current page’s blog’s content” is within a group. In my database, the “content” field contains the main information mixed with headings, and the issue is that “content” consists of a varying number of headings. In other words, “current page’s blog’s content” extracts the “content” from the database for the corresponding page, but it comes out unformatted (meaning my headings are indistinguishable from the body text)

Please provide screenshots of your database so we can see how things are structured.

I will give you an example on what I mean:

This is a formatted text where headings are highlighted, making the content structure immediately visible:

Introduction
Healthy eating is not just about losing weight or following a diet; it’s a lifestyle that promotes overall well-being. This text aims to explore the benefits of a balanced diet and how it positively impacts our health.

Benefits of Healthy Eating
Boosts Energy Levels: Consuming the right balance of nutrients provides our bodies with the necessary fuel for daily activities. Foods rich in whole grains, lean proteins, and fresh vegetables can significantly improve energy levels.
Improves Mental Health: Diet plays a crucial role in mental health. Foods high in omega-3 fatty acids, such as salmon and walnuts, are known to enhance brain function and mood.

Challenges and Solutions
While understanding the benefits of healthy eating, many face challenges in implementing it.
Time Constraints: Preparing nutritious meals can be time-consuming. Solution: Meal prepping in advance can save time during busy weekdays.

Conclusion
Embracing healthy eating habits is essential for a vibrant and disease-free life. By overcoming common challenges, we can all enjoy the myriad benefits of a nutritious diet.

In my case, it looks like this (headings are not highlighted):

Introduction
Healthy eating is not just about losing weight or following a diet; it’s a lifestyle that promotes overall well-being. This text aims to explore the benefits of a balanced diet and how it positively impacts our health.

Benefits of Healthy Eating Boosts Energy Levels: Consuming the right balance of nutrients provides our bodies with the necessary fuel for daily activities. Foods rich in whole grains, lean proteins, and fresh vegetables can significantly improve energy levels.
Improves Mental Health: Diet plays a crucial role in mental health. Foods high in omega-3 fatty acids, such as salmon and walnuts, are known to enhance brain function and mood.

Challenges and Solutions
While understanding the benefits of healthy eating, many face challenges in implementing it.
Time Constraints: Preparing nutritious meals can be time-consuming. Solution: Meal prepping in advance can save time during busy weekdays.

Conclusion
Embracing healthy eating habits is essential for a vibrant and disease-free life. By overcoming common challenges, we can all enjoy the myriad benefits of a nutritious diet.

Therefore, I would like to learn how to format text, considering that it is all within one text element

I have a good example, maybe with it you can understand me Challenges in Formatting Text - #6 by aarseniy604

Please provide screenshots of your database to better understand.

It is not clear how you store your data.
There is a trivial super simple solution to all this if you store your data as text. → Just store it as HTML then, and all your problem are solved.

If you store them as whole datatypes, then it’s different.

Understood.

As all your content is stored in 1 field. Then just save your content formatted in BBCode or HTML (better for SEO).

For BBCode, you can use the official Bubble plugin : “Rich Text Editor”

For HTML, I don’t have one in particular I can recommend. But there are plenty HTML editor. For instance : HTML CKEDITOR Plugin | Bubble

Then, on your post page, you either place an HTML element if you store the content as HTML, or a simple text element if you store it as BBCode and things will be formatted.

I apologize, I don’t quite understand how a text element can store the content as HTML. Maybe I need to drag the HTML element? Isn’t the “Rich Text Editor” intended for users to edit text on their end?

HTML, BBCode, those are standards for formatting text and visual elements.

In HTML, if you store this:

<h1>This is a Heading</h1>

it is displayed like this:

This is a Heading

(in BBCode its more something like [size=200]This is a Heading[/size])

HTML is the best for SEO. BBCode is easier as there are native Bubble plugins for this.

On your admin page where you create the posts, you’ll need one or the other BBCode or HTML text editor I mentionned in my previous post.
On the display page, where you display the post, you’ll need a HTML element or a simple text element to display the data formatted.

1 Like

Understood, thank you!

I recently encountered another problem lol, I used BBCode and it worked well, then I tried HTML for SEO purposes, and here I got stuck. I have correct HTML code, verified by external sources. I inserted this HTML code into an HTML element, and after previewing the page, the text no longer looks as neatly sorted as in the editor. Do you know what might be causing this?

Can you share the HTML you want to display?

(or just part of it as a full blog post may be long)

Use the rich text edit function on bubble when creating the content, or even when displaying it if it’s static.

So i am using the following HTML:

<h3>The Charm of Small-Town Living: Embracing a Slower Pace</h3>
<h4>April 5, 2024</h4>
<p>In the hustle and bustle of modern life, many of us find ourselves dreaming of a quieter, simpler existence. The allure of small-town living, with its close-knit communities and slower pace, has become increasingly appealing in recent years. Today, let's delve into the heartwarming charm of small-town life and explore why more people are trading city skyscrapers for country sunsets.</p>
<h5>The Heartbeat of the Community</h5>
<p>In small towns, the sense of community is palpable. Neighbors aren't just familiar faces; they're friends, confidantes, and sometimes feel like extended family. Community events, from local farmers' markets to town fairs, are not just social gatherings but integral parts of the social fabric that binds everyone together. There's a unique sense of belonging and togetherness that often eludes larger cities.</p>

2 screenshot shows how this code is rendered in an HTML element, 1 screenshot is after I click “preview”.


This topic was automatically closed after 70 days. New replies are no longer allowed.