Feature request: Custom Attributes documentation

I’ve noticed in the video on WordPress development (https://youtu.be/04VQfRaWJpc?t=181) that the custom attribute “blocs-wp-post-thumb” is being used. However I found no documentation at all about this custom attribute (or other potential custom attributes that apply to WordPress theming in Blocs) in the current documentation on WordPress.

Would it be possible to provide some documentation or a list of available custom attributes for WordPress theming?

Also, these custom attributes might open up possibilities to allow more things to be added to the customizer (https://codex.wordpress.org/Theme_Customization_API), for example:
blocs-wp-background-color to allow for a color selector in the customizer.

Thanks for such a great tool!

2 Likes

Yes I’m hoping to get stuck into the online docs next week.

I’m totally open to suggestions for short codes and data attributes. Ping me them if you have any as I’ll most likely miss them on the forum :+1:

1 Like

Several things I’m thinking about, but don’t know how feasible they are. The ones highest on my list of requests would be:

  • Background color per bloc/section
  • Adding a shortcode to a text-element that enables a editable text-field in the customizer. Let’s say you make a 3-columns layout with key selling points. This would make the text editable from the customizer, even if you already have 1 loop on the page.

Regarding point 2, wouldn’t this be best done with custom fields?

That’s one way of implementing this. The downside (in my point of view) would be the usability for the end user. My type of end users is able to use the customizer (and get’s access to it) but custom fields is quite a bit less user friendly / requires some more experience.

I was actually thinking more in terms of a global field, for example in the footer.
This article has a great example that show the “copyright text” as a field in the customizer (including example code): https://themefoundation.com/wordpress-theme-customizer/. Especially for use in global area’s I think this would be useful.

Again, I don’t know how feasible, but the field could be announced in the customizer as “(bloc id) text”. So if my footer’s id was “footer”, it could perhaps appear in the customizer as the “footer text” field?

1 Like

Another potential application of this:
A custom attribute that allows me to have the social links address updatable via the customizer.

1 Like

Has documentation on the custom attributes been place somewhere. I’m still unable to find it.

https://help.blocsapp.com/knowledge-base/custom-data-attributes/

1 Like

Hi Norm,

Thanks for the reply, I had found that page in the knowledge base.
However, what I was looking for was a list of the custom attributes for Wordpress such as “blocs-wp-post-thumb”.