Drupal theming tip: theme_ functions you should NOT override
Theme functions are designed so that they can be overridden, but the building block theme functions provided by Drupal core should be left alone.
In discussion with a colleague, who provided all the insight paraphrased below, talking about some of the Drupal gotcha's we've seen get talented people not sufficiently indoctrinated into the Drupal way.
With one site, the designer overrode a ton of theme functions.
Like lists. So now menu_list is no longer an ordered list but a gathering of content
By overriding the default theme, we don't mean a theme in this case but rather the core theme functions.
item_list is used ALL THE TIME.
It's a core way of doing lists.
And so when the designer overrode the core list theme, which had a global effect... the navigation block, menu blocks, views, etc, all wrecked
Of course all the resulting HTML, CSS and theming was then built up around this cut of Drupal's proverbial hamstring.
Overriding the core theme function was not the way to make changes in this case, though you can see where the temptation would be on that. But it is a temptation you must resist! For all the reasons described.
Just create a non_list and use that when needed.
It's just a matter of figuring out where farther up the chain you can make the default not called.
This should be in an introduction to Drupal theming: these are the functions that can be overridden, but should not be
All the lower level ones.
Comments
Post new comment