I decide to theme menu blocks in my drupal 6.x.
I have copied block.tpl.php into my theme folder and I have renamed it to block-menu.tpl.php
but it seems it doesn't work !!
How can I modify the theme for menu blocks?
You can user the theme developer module to check whether your template is called at all. It will show you what nameing conventions to use.
And just in case: You have to flush your caches to make sure new templates and theming methods are taken into account.
Actually, I think the problem is you re-named
You need to have BOTH otherwise drupal 6 won't look for the specific block template override.
In either case, clear caches after creating both templates.
Now you should be able to theme this specific menu block. For good measure, if you want to keep things clean, you can also create a directory structure for all of the templates, eg, create a tpl directory and then in there have subdirectories like block, node, page, etc, and put all your various templates in there.
To be more precise, re: Drupal 6 Template Suggestions
What's a template suggestion? It's an alternate template (.tpl.php) file that you have created to override the base or original template file. Suggestions only work when they are placed in the same directory as the base templates. In other words, if you want comment-blog.tpl.php to display in your browser, comment.tpl.php also needs to exist inside your theme and the two files must be in the same directory.
I am not sure what kind of development environment you have, but hopefully it is similar to MAMP, which I use for quick stuff on my macbook:
Now, if YOURTHEME already has a block.tpl.php, you can omit step 2, but just make sure that when all is said and done somewhere in or under the YOURTHERE directory, there is a directory that contains both block.tpl.php and block-menu.tpl.php. It could be in the base level directory, it could be in a subdirectory, regardless, just make sure both files are there. Also, make sure that YOURTHEME doesn't have a block.tpl.php elsewhere. If it does, make sure that block-menu.tpl.php is in that directory, eg, that you don't have two sets of block.tpl.php and block-menu.tpl.php files in different directories in YOURTHEME's directory structure for that would be confusing the theme registry build process and it would pick up only one of them.
Clear all caches to make sure the theme registry is rebuilt to see these new templates. If you have the admin_menu module installed you can do this easily from the leftmost dropdown menu.
Now you can edit block-menu.tpl.php to theme all blocks created by the menu module.
|show 3 more comments|