Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Built new subtheme from footheme - everything is fine.
Want to modify some of the output, like deleting "clearfix" attributes in some places.
Modiefied tpl files, but for the main menu:
<ul class="menu clearfix">
<li class="first leaf active-trail menu-item-640">
<li class="leaf menu-item-224">
<li class="last leaf menu-item-1283">
<a href="/groups">Grupės</a>
</li>
</ul>
found that I need to modify one of AT template.php files, but I do not to do that because after some accidenta update changes will be gone.
How to avoid this and remove "clearfix"?
If I try to add another fuction on my subtheme template.php file - I get error about previously declared fuction.
Maybe by pure css?
Comments
Comment #1
rogical CreditAttribution: rogical commentedYou can find menu api to alter menu link attributes.
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedYeah, its just a matter of adding your own override for theme_menu_tree() to your themes template.php file, I use a clearfix because so often these menus are floating the contained elements, but its easy to override and remove the clearfix - bummer this function does not use drupal attributes array.
Comment #3
jday CreditAttribution: jday commentedI created a subtheme of AT_commerce with footheme, it is called 'offtilt'. I'm trying to override the function: theme_form_element_label($variables), so I've copied the function to my offtilt template.php file and renamed it 'offtilt_form_element_label' and cleared the cache several times, it doesn't work.
Then I put the override into the at_commerce template.php file, and named it 'at_commerce_form_element_label' and it works as expected. Is that normal? Seems like the override in my subtheme should have worked.
Comment #4
mattbloomfield CreditAttribution: mattbloomfield as a volunteer commented