>_Last updated May 2, 2015. Created on June 2, 2008._
_Edited by Haarek, ccgearig, kalamityjane, margyly. Log in to edit this page._
_上次更新2015年5月2日。创建于2008年6月2日。由Haarek编辑、ccgearig kalamityjane,马吉·。编辑这个页面登录。_
>Effective Web design balances flexibility and simplicity. If a system is too simple, it can only be used for a single purpose - but if it is too flexible, it may be too difficult for new users to learn.
有效的Web设计平衡灵活性和简单性。如果一个系统过于简单,它只能用于一个目的——但如果它太灵活,这可能让新用户很难学习。
>Drupal strives to balance this by providing its users with the tools they need to make their own content management solution, while still providing some pre-built components to help them get started. Thus, it can be described both as a content management system (CMS) and a content management framework (CMF) - one system that strives to have the strengths of both, without their deficiencies.
Drupal努力平衡通过向用户提供他们需要的工具的内容管理解决方案,同时还提供一些帮助他们开始预构建的组件。因此,它可以被描述作为一个内容管理系统(CMS)和内容管理框架(CMF)-一个具有非常强的扩展而没有缺陷的系统
>Most CMS's are like a toy boat or truck - specific assumptions have been made about their use, assumptions that would be hard for you to override. Frameworks, on the other hand, provide you with raw materials only - you need to know a programming language and have a clear design vision to put them together.
大多数的CMS的就像一个玩具和卡车,是基对于他们特定的使用的假设,而这种假定是很难更改的(重写)。另一方面,框架,只为你提供了原材料,如此你需要懂得一种编程语言,还需要有明确的的设计思想,你需要将他们接合在一起。
>Drupal is like a Lego kit. Skilled developers have already made the building blocks - in the form of modules - that you need to create a site that suits your needs, whether that is a news site, an online store, a social network, blog, wiki, or something else altogether.
Drupal 就像一个积木工具.熟练的开发者以模块的方式已经开发了许多模块,例如你需要根据你的需求建立一个网站,哪可能是新闻网站、在线商城、社交网站、博客、百科、或者别的网站。
># Drupal in action
# Drupal的功能
>To make the contrast between Drupal and other CMS's more concrete, consider the example of a news site. You want to be able to post news articles on the site, and you want the homepage to have a section featuring the five most recent ones. Next, you decide that you want to add a blog section, and put a list of links to the five most recent blog entries on the homepage as well.
drupal和其他的cms更加的实用,例如我们考虑一下一个新闻网站,我们想要能够发布新闻,另外你也想能够有一块区显示你的最近发布的的5条博文在你的首页,接下来你想添加一条博文,并将链接发布在你的最近博文的条目里面。
>If you were using an ordinary CMS, first you would install a plugin that handled news articles and could put short blurbs on the homepage. Next, you’d install a plugin that would track the latest blog posts and put a list of those on the homepage. Each plugin would only be responsible for tracking and managing a particular kind of content, and would remain relatively isolated from the others.
如果你正在使用一个普通的cms,你首先要安装一个插件来处理你的新闻文章让他能够在你的首页显示,接下来你要安装另外一个插件跟踪你的博客文章,把他们展现在你的首页,每个插件跟踪和管理相应的内容,并相互对立
>But, what happens when you have that brilliant middle-of-the-night idea, and want to blend these two functions by showing a list of blog posts about the latest news items, ordered by most active contributor first? If you’re using a “toy truck” CMS, you may be out of luck, or need to hire a developer to write you a custom plugin from scratch. But through the power of the Drupal way, the way of manageable abstraction, you can whip out a kit full of parts and knock this together pretty quickly. (Hint: just use Views.) Since Drupal's modules do things in a standard way and interface with a common underlying system, building all sorts of clever, customized features is just a matter of snapping parts together.
但是,当你有一个很出色的想法你想要将两个功能合起来,将博文和新闻显示在一个列表里面,通过活跃度排序。如果你是使用的搭积木式的cms,你可能就悲催了,此时你可能需要雇佣一个开发者去定制你个人插件。但是通过drupal的力量,你可以通过抽象的管理方式,你能够使用一个工具包,将他们快速的整合在一块。(提示:使用视图)。因为drupal的模块和接口在同一个标准下同一个底层系统,建立各种各样智能的控件,定制的功能只是他的整体功能的一个附加的一部分。
>Of course, this flexibility comes at a certain cost. While a toy truck is instantly understandable and ready to use without much thought, a modular vehicle construction kit will by nature require you to read the instruction manual first. The building blocks are out there, but you'll need to learn how they fit together before you can take a paper prototype and turn it into a full-featured website.
当然,事情有利有弊,这种灵活是需要付出一定的成本的,积木式的cms可以很快的理解,另外不需要很高的学习成本的,但是模块化的cms 构建模块时你需要需要阅读大量的说明书,另外你需要学习将他们组合在一起的,在你将纸面上的原型转化问一个功能齐全的网站。
>Drupal core, and the thousands of contributed modules that build on it, require an initial investment to learn, but mastering the Drupal way is immensely rewarding; the passionate community is a testament to its power to liberate site builders from the simplicity/flexibility dilemma. Once you've tried Drupal, you'll likely leave your toy truck and boat in the closet gathering dust.
drupal的核心是成千上万个贡献模块构成的,这样我们需要一个初始的学习,但是对你掌握drupal极其有益的,热情的社区证明了他将网站的建设者从简单/灵活的困局中解放出来了,你一旦尝试了drupal,你可能会把你的积木式的cms扔进垃圾桶里。
># How Drupal does it
# Drupal是如何做到他呢?
>Intrigued yet? Let's take a closer look at how Drupal works.
感兴趣吗?让我们仔细看看Drupal是如何工作的。
>People often think of a website as a collection of static pages, with some functions (like a blog, or a news engine) thrown in to round it out. When they go to manage their site, they are thinking in terms of a tree-like hierarchy of pages that they will go in and edit.
人们往往认为网站是由一系列的静态网页组成的,它拥有一些功能(例如博客,新闻引擎等)。当他们管理网站的时候,他们认为他们编辑的是一些树形结构的网页。
>Drupal, on the other hand, treats most content types as variations on the same concept: a node (more on this in a moment). Static pages, blog posts, and news items (some possible node types) are all stored in the same way, and the site's navigation structure is designed separately by editing menus, views (lists of content), and blocks (side content which often have links to different site sections).
另一方面,Drupal用同一种方式来对待所有类型的内容:一个节点(在这个时刻),静态页面,博客文章,还有新闻条目(一些其它可能的类型)以同一种方式被存储,网站的导航结构是被设计成分离式可编辑的菜单,视图(内容列表),区块 (由指向网站其它部分的链接组成)等相互独立的组件构成的。
>It’s a lot like the separation you find in standards-compliant page coding—XHTML provides the meaningful structure of the information, while CSS arranges it for presentation. In Drupal, nodes hold the structured information pertaining to a blog post (such as title, content, author, date) or a news item (title, content, go-live date, take-down date), while the menu system, as well as taxonomy (tagging of content) and views, create the information architecture. Finally, the theme system, along with display modules like Panels, controls how all this looks to site visitors.
这跟页面和布局分离的编程很像——XHTML提供了结构信息,而css进行排版。在Drupal中,节点提供了和结构化信息有关的博客文章(标题、内容、作者、日期等)或新闻项目(标题、内容、时间),而菜单系统 ,以及分类 (内容的标签)和views,建立的信息架构。最后,主题系统,和显示模块如Pannels一同控制着访问者所能看到的页面。
>Since these layers are kept separate, you can provide a completely different navigation and presentation of your content to different users based on their specific needs and roles. Pages can be grouped differently, prioritized in a different order, and various functions and content can be shown or hidden as needed.
因为这些图层是相互独立的,所以您能够通过不同用户的需求和角色来为他们提供不同的导航栏和内容的展示。页面可以被分组,可以根据优先级的顺序来显示,可以许多其它的功能,可以根据需要来使用内容显示或隐藏。
># Nodes: The secret to Drupal's flexibility
# 节点:Drupal的灵活性的秘密
>We don't talk about "nodes" every day, but since they are at the heart of Drupal's design, they deserve further investigation. At its most basic, a node is a set of related information. When you create a new blog post, you are not only defining its body text, but also its title, content, author link, creation date, taxonomy (tags), etc. Some of these elements will be shown by the theme layer when the node is displayed. Others are meta-data that control when the node will show up at all - such as taxonomy or publishing status.
我们不会天天都讨论“节点”,但是由于这是Drupal设计的核心,应该对它进行进一步的研究。
从根本上说,一个节点是一系列相互关联信息的组合。当你创建一个新的博客文章,你不仅仅定义了它的正文内容,而且还包括它的标题,内容,作者链接,创建日期,分类信息(标签)等等。当一个节点被展示时,他的一些元素将被暂时在主题上,其他的元数据也是将出现的,例如分类和发布状态。
>Since each item of content is stored as a node, and contains the same basic information, each can be handled in a standard way by both Drupal core and contributed modules. This allows site builders to choose exactly where they want content to show up, and exactly how they want it to look in each case. Most of a Drupal site builder's time is spent defining what kinds of information you want to store in your nodes, and configuring the structures (menus, taxonomy trees, views, panels) in which to display them.
由于所有的内容条目都被存储为节点,并且包含了同样的基本信息,所有的这些信息都可以被Drupal核心和贡献模块以一种标准方式来处理。这使得网站建设者能够准确的选择内容放置的位置,和以怎样的方式去显示。大多数的Drupal站点建设者的时间都花在决定节点包含的内容上,和配置架构(菜单,分类树,视图,面板)上。
>As suggested before, you aren't limited to a single way of presenting your site's content. You can define as many navigation schemes, custom themes ("skins" for the site), blocks (small bits of content, such as the five most recent blog articles described earlier), and feature sets as there are distinct audiences for your site.
就跟前边提到的一样,您不仅仅有一种方式去展示您网站的内容。您可以定义多种导航计划,自定义主题(网站的皮肤),区块(小块内容,例如前边提到的最近五条博客文章),为您网站用户提供独特的功能集。
>Comments are second-class citizens in Drupal compared to nodes, but they also illustrate the Drupal way. Comments aren't just part of the blog system, since there isn't a separate "blog system." Comments can be enabled on any node type you choose - blog posts, news items, book pages (which provide basic wiki features) and any other you may create.
跟节点相比,评论是Drupal中的二等公民,但是它同样阐明了Drupal的方式。评论不仅仅是博客系统的一部分,因为Drupal没有一个独立的“博客系统”。评论可以使用在您选择的所有节点类型——博客文章,新闻条目,书籍页面(提供了基本的维基功能)等任何您想创建的类型。
># Collaborative at the core
#核心是协作
>Creating an informational website that broadcasts from “one to many” is something that most CMS's do right out of the box. However, where Drupal really shines is when you want to empower site users to create content, and connect with each other - moving from "one to many" to "many to many."
许多内容管理系统做成一个可以以“一对多”方式广播的成品。但是,Drupal闪亮的地方就在于当您想授权网站用户创建内容,和其他人建立关系时从“一对多”变为“多对多”。对于一些内容管理系统,您可以创建一个博客,并且您可以通过安装插件来动作一个社区,但是当您想给所有用户建立个人博客,通过为他们的内容排序来使用它们能以自己的方式独立显示的同时生成专题文摘、最火的五篇文章、链接到外部、自定义用户个人档案该怎么办?如果您想把它整合成论坛,类维基环境,并且让每个用户创建包含标签的图像集?Drupal是由底层一步一步建造起来的,所以网站建设者可以把文章创建甚至网站管理的权限委托给用户。你要做的只是决定谁做什么(通过用户权限配置),然后您就可以开始协作了。
># Get started quickly, customize extensively
#上手容易,可定制性强
>Drupal's flexibility is incredible, but installing it is surprisingly easy. With a simple FTP upload and a few short web-based configuration questions, you can connect with your database and have your first Drupal site up and running within an hour.
Drupal的扩展性强得难以想象,但是安装起来却非常容易。您只需要通过FTP进行一次上传和一些简单的web配置就可以,您可以连接您的数据库并且在一小时内就能让您的网站建好。
>Pick one of the included themes, and just start adding content. Do you want to have visitors log in? Switch authentication on or off. Want to switch on some of the included tools? Turn on forums; enable commenting on node types; turn on the book module for wiki-like collaboration; create forums and polls; use taxonomy to give site content structured, hierarchical categorization or free-form tagging.
选择一个现有的主题,然后开始添加内容。您想要您的访问者登陆吗?打开或关闭用户验证系统。想要开启一些内置的工具?使用论坛;根据节点类型启用评论;开启book模块进行类维基的协作;创建论坛和调查;使用分类来使网站结构化,层级分类或者自由标签。
>Do you want your own skin applied to the site? Drupal's theme system uses tiny snippets of PHP that you can insert into the appropriate spots in your design to replace your placeholder Lorem Ipsum text with dynamic content. Drupal’s generated markup is clean, standards-compliant XHTML. No old-school tables. No cruft. No kidding.
您想要使用自定义的皮肤?Drupal的主题系统使用很少的PHP代码,可以使您能够在适当的位置替换成您想要添加的动态内容。Drupal生成的标记十分简洁又符合标准XHTML规格。没有老旧的表格,没有令人讨厌的东西,没有多余的东西
># The Drupal flow
#Drupal的流程
>If you want to go deeper with Drupal, you should understand how information flows between the system's layers. There are five main layers to consider:
如果您想更深一步了解Drupal,您需要理解信息在各个系统层级之间的流动情况。Drupal包括五个主要的层级:
![2015-06-08/5575058894252](https://box.kancloud.cn/2015-06-08_5575058894252.gif)
>1、At the base of the system is the collection of nodes—the data pool. Before anything can be displayed on the site, it must be input as data.
1.在系统的最底层是节点集——也就是数据池。在网站上的内容被显示之前,必须输入结点作为数据。
>2、The next layer up is where modules live. Modules are functional plugins that are either part of the Drupal core (they ship with Drupal) or they are contributed items that have been created by members of the Drupal community. Modules build on Drupal's core functionality, allowing you to customize the data items (fields) on your node types; set up e-commerce; programmatically sorting and display of content (custom output controlled by filters you define); and more. There are thousands of different options within the fast-growing repository of contributed Drupal modules. They represent the innovation and collaborative effort of everyone from individuals to large corporations.
2.往上一层是模块。模块是Drupal核心或被Drupal社区成员贡献的实现各种功能的插件,可以让您在您的节点类型上添加自定义的区段;建立电子商务系统;对显示出来的内容进行排序(通过您设定的条件过滤输出内容)等。在成长迅速的Drupal贡献模块仓库 (link is external)有成千上万的不同模块。这反映了每个人到每个大公司的创新和协作能力。
>At the next layer, we find blocks and menus. Blocks often provide the output from a module or can be created to display whatever you want, and then can be placed in various spots in your template (theme) layout. Blocks can be configured to output in various ways, as well as only showing on certain defined pages, or only for certain defined users. Menus are navigators in Drupal, which defines the content coming on each defined menu path (relative URL). Menus are core element of Drupal which gives all the pages created in Drupal
3.再往上一层是区块和菜单。区块通常会提供模块的输出或者任何您想要显示的东西,并且可以通过主题把它添加到各个地方。区块可以通过多种方式来显示,而且可以在特定的页面显示或者显示给特定的用户。
>4、Next are user permissions. This is where settings are configured to determine what different kinds of users are allowed to do and see. Permissions are defined for various roles, and in turn, users are assigned to these roles in order to grant them the defined permissions
4、再往上是用户权限系统。您可以定义各种读和操作特定内容的权限给一些用户。权限被定义成各种角色,然后您可以把这些角色赋给相应的用户以给他们赋予相应的权限。
>5、On the top layer is the site theme (the "skin"). This is made up predominantly of XHTML and CSS, with some PHP variables intermixed, so Drupal-generated content can go in the appropriate spots. Also included with each theme is a set of functions that can be used to override standard functions in the modules in order to provide complete control over how the modules generate their markup at output time. Templates can also be assigned on-the-fly based on user permissions.
5、最高层是网站主题(皮肤)。它是由具有优越性的XHTML和CSS混合着一些php变量片段构成的,所以Drupal生成的内容可以出现在任何适当的地方。每个主题还包含一系列的功能用来覆写模块的输出。模板也可以跟据用户权限来设定。
>This directional flow from bottom to top controls how Drupal works. Is some new functionality you want not showing up? Perhaps you uploaded the module into the system but have not activated it yet, and this is making everything downstream non-functional (as in "A" in the diagram above).
这个从下往上的流程显示了Drupal的工作过程。是不是有您想要的新功能没显示出来?或许您上传了这个模块,但是您还没有把它激活,使得下游的功能都没有实现(跟图中的“A”一样)。
>Maybe the module is installed and activated, but you still don’t see what you want on your site. Did you forget to place the block, as in "B"? Or are your user permission settings conflicting with what you want and your users are not set to see the output as in "C"?
或许您已经把模块安装激活,但是您还是没有看到您想要的。您是不是忘记放置模块,跟图中的“B”一样?或者您的权限没配置好,就跟图中的“C”一样?
>Additionally—as mentioned earlier—getting the kind of granular control you want over the details of the XHTML module outputs requires understanding this flow. Are you using a module that does exactly what you want, only you wish the markup was just a little bit different? Maybe you’d like it to use different tags, or you’d like to assign a CSS class to something? You accomplish this by copying the output function from the module and pushing it up to the functions document in your theme. Modify the code there, and when the system goes to output, it will see your customized function and use that instead.
另外——前边提到过——要想对模块输出XHTML进行跟细微的设置,您需要理解这个流程。您是否在使用一个能够准确的满足您需要的模块,或者您想把标记进行细微的更改?或者您想使用不同的标签,或者您想添加一个CSS类在某处?您可以通过从模块里复制函数并把它放置到主题的函数文档中来实现您的需求。修改了代码之后,当系统输出的时候,您将会看到并且可以使用您所定义的函数。
># Get up close and personal
亲自体验
>ow that you’ve gotten a brief introduction to the Drupal way, why not install Drupal on your server and try it for yourself? The Installation & Configuration guide gives step-by-step instructions if you need help getting started.
Welcome to the community of Drupal users, and happy site building!
既然您已经对Drupal的方式有了一个简单的了解,为什么不在您的服务器上安装Drupal (link is external)并且亲自试一试?这个安装与配置指南 (link is external)为您一步一步介绍怎样安装并试用Drupal.
欢迎加入 Drupal 用户社区,祝您建站愉快!