Drupal:如何主题模块 [英] Drupal: How to theme a module
问题描述
特别是我正在 http://drupal.org/project/service_links 工作
任何想法如何工作?
提前感谢!
一般来说,如果你想主题一个模块,你有几个选择。
-
覆盖主题功能。您可以覆盖模块使用/实现的主题功能来更改标记,这种功能的一个示例是
theme_service_links_node_format
。你更改在你的主题的template.php中调用一个名为'your_theme_name_service_links_node_format'的函数,然后在其中自定义标记。 -
CSS。如果您不需要更改模块输出的实际标记,则只需添加所需的css,将其主题化为您的喜好。
-
在某些情况下,它不像Sercive链接是这样的情况,您也可以自己创建模板,并使Drupal使用它们。
-
另一种方式,再次看起来不像服务是服务链接就是这样的情况,是在你的template.php中实现预处理函数。如果要更改某些模板变量的生成方式,则需要这样做。
I'm trying to theme a modules output. In particular i'm working on http://drupal.org/project/service_links
Any idea how that works?
Thanks in advance!
Generally, if you want to theme a module you have a few options.
Overwrite theme functions. You can overwrite the theme functions that the module uses/implements to change the markup, one example of such a function is
theme_service_links_node_format
. You change make a function in your theme's template.php called 'your_theme_name_service_links_node_format' and make your custom markup in it instead.CSS. If you don't need to change the actual markup of a modules output, you only need to add the needed css, to theme it into your liking.
In some cases, it doesn't look like sercive links is such a case, you can also make your own templates, and make Drupal use them instead.
Another way, again it doesn't look like service is service links is such a case, is to implement preprocess functions in your template.php. This is needed if you want to alter how certain template variables are generated.
这篇关于Drupal:如何主题模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!