Make "basic text" a "p" instead of a "div"

Make “basic text” a “p” instead of a “div”. It’s more semantically correct.

1 Like

On the contrary, I don’t need a “p”. And if you need to, then here

I will approach this post as a question of “How to set Basic text element tag to be “p” as default instead of “div””.

First of all, it isn’t as simple as I thought it will be, so I don’t have an answer yet.

There is no theme setting for default tag on Basic text element, contraty to the Heading element. So one way would be to create a feature request for it.

For future reference and searches if someone tries to do it in a dev way, please note that currently (v1.7.3):

  1. The placeholder seen in the HTML tag field is set with element’s controls, precisely “placeholder” value in “tag”. See includes/elements/text-basic.php.
  2. The items seen in the dropdown are set with element controls, precisely “options” value in “tag”. See includes/elements/text-basic.php.
  3. BUT the default tag that is rendered on the frontend DOESN’T take neither the placeholder nor the first item in the dropdown. It is set globaly as a “div”. See includes/elements/base.php (line 33).

It would be nice to have a way to change it however I would love to avaoid cluttering the builder with tons of ultra-specific filters that get used by less than 1% of users.

@timmse do you think you could either a) add an option in the theme settings similar to headings default tag; or b) change the behavior of default tag so that it takes the first item of the “options” as this list can be altered with bricks/elements/{element_name}/controls.

1 Like

Of course I know I could change the tag, but what the aim to set a basic text as a “div” ? It’s not semantically correct !

It’s not a how to post, but a why this silly choice ?
By default basic text should be a “p”

1 Like