我有兴趣为我正在处理的 Drupal 站点创建自定义主题.我是 Drupal 的新手,但是我在处理构建主题(CSS、PHP、HTML)所需的基本概念方面有相当多的经验.
所以,我的问题是 - 我从哪里开始?是否有创建 Drupal 主题的规范指南?我应该了解哪些资源(主题指南除外)?其他人遇到的问题,或者只是经验丰富的人的一般智慧?
I'm interested in creating a custom theme for a Drupal site I'm working on. I am new to Drupal, however I have a decent bit of experience in working with the underlying concepts that it seems are needed to build a theme (CSS, PHP, HTML).
So, my question is - where do I start? Is there a canonical guide to creating Drupal themes? Resources that I should be aware of (other than the Theming Guide)? Gotchas that others have encountered, or just general words of wisdom from those who are more experienced?
最好的方法是从一个主题开始,一点一点地修改它.我认识的大多数人都是这样做的.您获取 themes/garland 目录并将其复制到 sites/all/themes/garland-modified,然后更改其中的一些内容以反映新更改(原则上您将 .info 文件重命名为新目录位置,然后编辑它以将 garland 更改为您的新目录),然后您一点一点地更改文件中的内容以反映您的设计.
The best way to do it is to start with a theme, and modify it bit by bit. That's how most of the people whom I know do it. You take the themes/garland directory and copy it to sites/all/themes/garland-modified, then you change a few things in it to reflect the new change (in principle you rename the .info file to the new directory location and you edit it to change garland to your new directory), then you go bit by bit and change things in the files to reflect your design.
这可能看起来乏味且浪费时间(为什么不从头开始?)但您有几个优点:
This may seem tedious and a waste of time (why not just start from scratch?) but you have several advantages:
有些入门工具包应该可以让事情变得更简单(例如,请参阅禅宗主题),您基本上可以按照我上面概述的类似方式对其进行编辑.但我发现它们有点难以理解...
There are starter kits which are supposed to make things easier (see the zen theme for example) which you basically edit in a similar way I outlined above. But I found them a bit harder to understand...
祝 Drupal 主题好运 :)
Good luck with Drupal theming :)
这篇关于Drupal 模板/主题资源或建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!