Drupal 模板/主题资源或建议?

2023-06-23php开发问题
6

本文介绍了Drupal 模板/主题资源或建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有兴趣为我正在处理的 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 模板/主题资源或建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17