简体   繁体   English

覆盖/自定义 Drupal 模块

[英]Overriding/customizing Drupal modules

I would like to override custom user template in my Drupal 7 installation.我想在我的 Drupal 7 安装中覆盖自定义用户模板。 The question is - should I edit the template file in the main module or copy the module to my theme's folder and edit it there?问题是 - 我应该在主模块中编辑模板文件还是将模块复制到我的主题文件夹并在那里编辑? In case of the second option, how can I do it?如果是第二种选择,我该怎么做?

You should definitely create a subtheme to customize the look and feel.您绝对应该创建一个子主题来自定义外观。 Otherwise, every time you upgrade core you will have to reapply your changes.否则,每次升级核心时,您都必须重新应用更改。 You can subtheme the default Drupal 7 theme (Bartik) by following these steps .您可以按照以下步骤对默认 Drupal 7 主题 (Bartik) 进行子主题化。

Once you have done that, copy the user-profile.tpl.php file into your subtheme directory (/sites/all/themes/mytheme).完成后,将 user-profile.tpl.php 文件复制到您的子主题目录(/sites/all/themes/mytheme)中。

Finally, make the changes you want to make to user-profile.tpl.php最后,对 user-profile.tpl.php 进行您想要进行的更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM