It drives me absolutely insane that I can’t target drag-and-drop tags with classes or IDs! The drag-and-drop system has potential, but the current implementation is very weak. Adding class and ID selectors would resolve a lot of issues, or at least allow developers to make more viable band-aids until the system is improved.
It’s super disappointing that this was requested almost a year-and-a-half ago and HubSpot has still not responded.
Thank you so much for suggesting this idea! I am currently working on the new Hubspot DnD theme and encounter the same problem (even though that the old template system has similar function). Please add this to the new DnD system
Hi guys, this may be in a simular vein to what is being discussed, recently I need to round some corners on selected images on a drag and drop template, it should be as easy as clicking the image and then adding a custom class to said image
My solution was to add a code word to the alt tag on the image i.e. [round] and then to write some JS code to remove the special word (for good SEO practice) and then inject a custom class. Works perfectly, but it’s a dirty solution
Please hubspot allow custom classed on standard DND sections.
Here is what I wrote if anyone needs it,
document.addEventListener("DOMContentLoaded", function (event) {
const imgElements = document.querySelectorAll("img");
for (let i = 0; i < imgElements.length; i++) {
let currentImg = imgElements[i];
let altText = imgElements[i].alt;
let titleText = imgElements[i].title;
if (altText.indexOf("[round]") >= 0) {
console.log(altText);
console.log("found image to round");
// step one - remove [round] from alt
currentImg.alt = altText.replace(" [round]", "");
currentImg.alt = altText.replace("[round]", "");
// step two - remove [round] from title
currentImg.title = titleText.replace(" [round]", "");
currentImg.title = titleText.replace("[round]", "");
//add custom class to image for rounded corners
currentImg.classList.add("roundcorner-img");
}
}
});
Is this something that’s going to be added? There are a lot of advantages of having the ability to add custom css classes and ID’s to sections, rows, and columns (responsive design, anchors for custom URL’s, etc.). Please please Hubspot, can we get this added!!
@ellimccale the doc is regarding adding classes inside the template itself, not adding it from the editor. This would be fine if you have a DnD section coded into the template, and you don’t expect anyone to do anything to it from there.
However, imagine you have an empty DnD area, and you want to work from there. It’s not possible to add any custom classes or IDs from the frontend editor.
This would make a lot of things so much easier. It would be nice to not have to spend so much time building custom stuff just to make some simple CSS changes. Default modules/columns/sections could be used so much more.