>_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包括五個主要的層級:

>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 用戶社區,祝您建站愉快!