Sometimes an ad will have too much, or too little text compared to the others, or maybe a distinctive look is required. To make the ad look different a custom class needs to be added.
A Neto user, Hayley Tuller, suggested a custom CSS field and B@SE tag for advertising campaigns way back in 2019 and still nothing has been done, even though it would be easy to do I expect. This lack of interest in improving Neto is concerning and casts doubt on how long the platform will be around.
Anyway, below is way to add it using some JavaScript, and this can go into the file /themes/[theme-name]/templates/footers/includes/scripts.template.html. It works well but if Neto listened to users, it would be unnecessary.
/* -------------------------------------------
Pass a custom class from the NETO Ad Text field to the div.carousel-caption.
Custom CSS for each banner ad on Neto's Webstore/Advertising Campaigns.
In the "Ad Description" field add your custom class, for example:
80th Anniversary End of World War II [class:my-ad-class] "my-ad-class" is
added the parent DIV.
---------------------------------------------*/
jQuery("div.carousel-caption h3:contains('[class:')").each(function () {
var adText = jQuery( this ).text();
var captionClass = adText.match(/\[class\:(.+)\]/);
jQuery( this ).parent().addClass(captionClass[1]); // [0] element is the entire found search string.
jQuery( this ).text(adText.replace(/\[class\:.+\]/, ""));
});
You must be logged in to post a comment.