• Hi. I’m new to this.

    I develop small (child)-themes for clients that target their needs.

    Everything was fine until Gutenberg and WP5 appeared. Now I have to build my themes for that combo and the html output (classes and ids mainly) is quite different from the previous WordPress. I don’t want to add anything to the controversy but I have just some questions:

    — Why have the ids (eg “gallery-1”) disappeared ? It was quite useful to have them in each post to be able to target individual items. Will they reappear ?
    — Galleries: .portrait and .landscape classes associated with images was really useful for specific layout. Why don’t keep them ?
    — Will it be possible to output individual elements (blocks / block-types) with a specific function (like has_gallery or has_thumbnail_image) ? This would be really useful to make posts uniform, prevent user from breaking everything and make more complex layouts based on content.

    I guess my demands won’t be fulfilled. So is there a way to add more syntax elements to posts, maybe with custom post types ? I’m not familiar with that and don’t know if it is supported in Gutenberg.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You can create custom Gutenberg blocks that wrap added content in whatever HTML you want. I’ve yet to develop any such blocks myself, so I’m fuzzy on the details. I would expect block code to be able to determine the aspect of inserted images and add the appropriate class. I would also expect that we can remove default blocks once we’ve developed alternatives so it’s not ambiguous which block to use for a particular purpose.

    Custom blocks are probably the most exciting Gutenberg feature for developers. While the need to learn about yet another API is not exciting, the potential these bring should excite any developer who wants to remain relevant.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The gallery css changes are intentional https://github.com/WordPress/gutenberg/issues/2900

    I would open an issue about the landscape/portrait issue, but the image number (gallery-1) can still be done with pseudo css classes, as I understand it.

    Your final question is development related and not something we can assist with here.

    I’m closing this post as a part of forum gardening pre 5.0

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Gutenberg html output’ is closed to new replies.