đž Archived View for chirale.org âş 2008-03-17_50.gmi captured on 2024-08-18 at 17:34:01. Gemini links have been rewritten to link to archived content
âŹ ď¸ Previous capture (2024-05-12)
-=-=-=-=-=-=-
Tested on:
Customizing Drupal form appearance may sound difficult. But to add a CSS class is (surprisingly!) simple using theme_fieldset themeable function.
* If youâre using a Zen theme, change theme_fieldset to zen_fieldset. You can try to use this method with your theme prefix.
* If youâre using a theme based on phptemplate engine, you can change theme_fieldset to zen_fieldset to have the same effect of above (try one of this, not both).
Iâve attached an example to generate CSS class from fieldset title: Add CSS class to drupal form fieldset.
Add CSS class to drupal form fieldset
\# custom fieldset CSS class from element \#title
$css_class = âmy-custom-class-â;
$css_class .= str_replace(â â,â-â,strtolower($element\[â#titleâ\]));
\# using transliteration module to transliterate/strip non-ASCII character where available
if(module_exists(âtransliterationâ)){
\# including Transliteration functions
require_once(drupal_get_path(âmoduleâ, âtransliterationâ) .â/transliteration.incâ);
$css_class = transliteration_clean_filename($css_class);
}
Adding this code to your template:
* e.g. âImpostazioni del menĂšâ
* e.g. âmy-custom-class-impostazioni-del-menuâ
* e.g âcollapsible my-custom-class-impostazioni-del-menuâ
I apply a previous substitution of whitespace using â-â (transliteration module use underscore â\_â) and you can do the same, but later remember to use transliteration_clean_filename to safely sanitize class name for any other case youâve not contemplated (accents, special characters).
https://web.archive.org/web/20080317000000*/http://api.drupal.org/api/function/theme_fieldset/5
https://web.archive.org/web/20080317000000*/http://api.drupal.org/api/function/theme_fieldset/5
https://web.archive.org/web/20080317000000*/http://drupal.org/phptemplate