更改 Drupal 页面的语义标记

发布于 2024-12-18 06:06:54 字数 511 浏览 4 评论 0原文

所以我对 Drupal 还算陌生,并且正在让该网站按照我希望的方式运行。我面临的挑战之一是,当我打开 index.php 页面(默认的登录页面)时,它似乎没有我在常规 HTML 页面中寻找的语义标记。可以理解的是,Drupal 在内部执行此操作,因此它必须隐藏在某个地方。与此相关的几个问题如果你们中有人能回答,那就太好了:

  1. 默认 drupal 页面的语义布局是什么?据我所知,它有侧边栏、导航、正文内容等区域。有没有地方可以让我了解默认 Drupal 页面的组织方式?

  2. 如何更改 drupal 页面的语义布局?本质上它是在哪里创建的,因为那是我想去编辑那个宝贝的地方。另外,这是否可取?

  3. 一个非常集中的问题:我想改变菜单的外观。我希望菜单获得浏览器窗口的完整宽度,不幸的是,这是我无法涉足当前菜单的事情,因为它们似乎与侧边栏混在一起?

可以理解,Drupal 很棒,但它确实给我新手带来了困难。欢迎您的解答、批评!

谢谢帕里贾特

So I am reasonably new to Drupal and am having the site behave the way I would like it to. One of the challenges I am facing is that the index.php page (the default, the landing page) when I do open it up, it does not seem to have the semantic markup that I am looking for in a regular HTML page. Understandably Drupal does this internally so it must be hidden somewhere. Pertaining to this stems a few questions which if any of you guys can answer, would be really nice:

  1. What is the semantic layout of a default drupal page? I understand it has areas such as sidebars and navigation, body content. Is there a place where I can read how a default Drupal page is organized?

  2. How can I alter the semantic layout of a drupal page? Essentially where is it being created, coz that's where I want to go and edit that baby. Also, is this advisable?

  3. A very focussed question: I want to change the way the menu looks. I want the menu to acquire the full width of the browser window, unfortunately this is something I cannot do dabbling with the current menus, since they seem to mess around with the sidebars?

Understandably Drupal is great but it does give me a hard time to newcomers. Your answers, criticisms are most welcome!

Thanks

parijat

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

芸娘子的小脾气 2024-12-25 06:06:54

关键点:不要将 Drupal 视为一个可以通过“简单地破解 index.php”来定制的系统,否则几天之内你就会完蛋

Drupal 有一些架构概念与许多“纯 PHP”系统。如果您想使用 Drupal 做任何超出显而易见的事情(安装后忘记),那么投入时间来了解 Drupal 的结构确实值得。这包括(但不限于)了解主题机制如何工作、菜单如何生成以及块如何管理。

对我来说,关于 Drupal 概念的最好的介绍是“Pro Drupal 7 Development ”。迄今为止,它是学习和理解 Drupal 的最佳单一资源,并且物有所值。另外,如果您还没有阅读过 Drupal 7 文档,尤其是“了解 Drupal< /a>”。

显然,您可以尝试简单地对 Drupal 进行“逆向工程”,但是 - 相信我 - 这可能比仅仅通过阅读更高级别的文档来理解系统要痛苦得多。

Key point: don't view Drupal as a system that can be customized by "simply hacking index.php" or you will be doomed within a matter of days

Drupal has some architectural concepts that are fundamentally different from many "plain PHP" systems. If you want to use Drupal to do anything beyond the very obvious (install and forget), it is really worth investing your time in understanding how Drupal is structured. This includes (both is not limited to) in understanding how the theming mechanism works, how the menus are generated as well as how the blocks are managed.

The best ever introduction to Drupal concepts for me has been "Pro Drupal 7 Development". It is - by far - the best single resource for learning and understanding Drupal and well worth its price. Also, in case you already haven't I really urge you to read through the Drupal 7 documentation, especially "Understanding Drupal".

Obviously, you can try to simply "reverse-engineer" Drupal, but - believe me - it is likely much more painful than just understanding the system by reading through a more higher-level documentation.

葬花如无物 2024-12-25 06:06:54

您几乎肯定不想编辑任何 Drupal 代码文件。那就是疯狂所在。

不过,如果听起来您只是想调整页面模板。其中一些将由您的主题指定,因此请查找类似 sites/all/themes/omega/omega/templates/ 的路径,其中包含一堆文件,例如 html.tpl.php,即 ...例如,我们网站的 部分。

前提是你不要对 这些文件的部分,您可以根据自己的喜好编辑语义 HTML。

不过,您必须深入研究某些内容,并且不同的模块会将其 HTML 放在不同的位置。

You almost certainly don't want to be editing any of the Drupal code files. That way madness lies.

If sounds like you just want to tweak the page templates, though. Some of those will be specified by your theme, so look for a path like sites/all/themes/omega/omega/templates/ containing a bunch of files such as html.tpl.php, which is the <html> ... </html> part of our site, for example.

Provided you don't do anything stupid to the <? php ... ?> parts of these files, you can edit the semantic HTML to your heart's content.

You will have to delve deeper for some things, though, and different modules will put their HTML in different places.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文