1

If you visit official website of Dries Buytaert https://dri.es/ and look into the source you will see very clean and minimal markup with no unnecessary tags and classes, eg:

enter image description here

When I create a simple custom block it has lots of junk under each field, eg:

enter image description here

How to strip and delete all the junk and leave or add only classes and wrappers you need?

I did look up Fences, but it's latest version is in alpha since 2016 (and not sure if it does that) and cannot figure out how to strip at least classes with Display Suite extras module, it seem that it doesn't do anything, went though all settings.

Did Dries use any of known public modules or is it all custom code?

4
  • 2
    This would best be done with custom templates. A problem to look out for is some actions require those divs and wrappers, such as Ajax callbacks and quick actions. If you change the markup and get errors, that’s something to look for. Jul 8 '19 at 15:40
  • 3
    This is no junk, this is the HTML and CSS required and defined by the theme and modules you use. If you want a more minimal markup, you have to create your own theme with your own templates, but remember that modules like QuickEdit or Layout Builder require a specific markup structure based upon the markup of the stable core theme.
    – Hudri
    Jul 8 '19 at 15:44
  • 1
    @Hudri can you post this as an answer, please. Both comments useful. Jul 8 '19 at 18:04
  • Do not use Fences, Display suite etc. you do not need them.
    – Kevin
    Jul 8 '19 at 22:09
2

This is no junk, this is the HTML and CSS (classes) required and defined by the theme and modules you use.

If you want a more minimal markup, you have to create your own theme with your own templates, but remember that modules like QuickEdit, Views or Layout Builder require a specific markup structure based upon the markup of the stable core theme.

Regarding dri.es: He seems to be using a custom, minimal theme and a very reduced setup with many modules disabled (e.g. QuickEdit will not work with his theme).

4

A lot of those classes are added by the classy base theme templates. You'll be able to get rid of them with a theme based on stable instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.