Мелансон Б., Нордин Д., Луиси Ж. и др. - Профессиональная...

688
С^П П ТЕР®

Upload: alex-faranume

Post on 29-Dec-2015

226 views

Category:

Documents


4 download

TRANSCRIPT

  • ^

  • Benjamin Melancon, Allie Micka, Amye Scavarda and others

    The Definitive Guide to Drupal 7

    Benjamin Melancon, Jacine Luisi, Karoly Negyesi, Greg Anderson, Bojhan Somers.

    Stephane Corlosquet, Stefan Freudenberg, Michelle Lauer, Ed Carlevale, Florian Loretan,

    Dani Nordin, Ryan Szrama, Susan Stewart, Jake Strawn, Brian Travis, Dan Hakimzaaeh,

    Amye Scavarda, Albert Albala, Allie Micka, Robert Douglass, Robin Monks,

    Roy Scholten, Peter Wolanin, Kay VanValkenburgh, Greg Stout, Kasey Qynn Dolin,

    Mike Gifford, Claudina Sarahe, Sam Boyer, and Forest Mars, with contributions

    from George Cassie, Mike Ryan, Nathaniel Catchpole, and Dmitri Gaskin

    Apress*

  • Drupal

    Drupal 7. , . , , . , . , . ,

    . , . , . , . , . , . ,

    . , . , . , . , . , . ,

    . , . , , , . , ,

    . , . . , . , . , . , . ,

    . , . , . , .

    ^ *

    - -- -

    2013

  • 32.988.02-018

    004.738.5

    84

    ., ., . .84 Drupal 7. .: , 2013. 688 .:

    .

    ISBN 978-5-4461-0054-5

    CMS Drupal 7, Drupal. , , 7- , , Drupal. , () , Drupal, - CMS, , , Drupal.

    , , Drupal, , .

    32.988.02-018

    004.738.5

    Apress. . ., , , . , , , .

    ISBN 978-1430231356 . aPress, 2011ISBN 978-5-4461 -0054-5 , 2013

    , , 2013

  • ................................................................................................ 17

    I.

    1. Drupal 7 ...................................... 34

    2. : Drush G it......................................... 56

    II.

    3. Views..................................................... .70

    4. ...................................................104

    5. Organic Groups .............................................................122

    6. Drupal.............................................................. 135

    7. Drupal.....................................................................146

    8. .....................................................................156

    III.

    9. Drupal- ......... .......................................................192

    10. .................................................. 200

    11. ....................................................................... 216

    12. .................................................................. 222

    13. .. 237

    14. ............................................................... 253

  • 6

    IV.

    15. .........................................................................................258

    16. .............................294

    V.

    17. ..........................................334

    18. API .......................................357

    19. ..................................................................406

    20. Drupal 7................................................426

    21. ...........................440

    22. Simpletest......................... .........454

    23. ....................... ........................468

    VI.

    24. Drupal Commerce........................................................498

    25. Drush....................................................................526

    26. Drupal......................................................564

    27. Drupal................................................ 581

    28. Drupal.......................595

    29. Apache Solr Search Integration.....................608

    30. : 90 % ....................... ....... 620

    31. Drupal ............673

  • ..................................................................................................17 Drupal?.......................................................................................................17 Drupal 7 ..................................................................................................... 20 ............................................................................................25 Drupal....................................................................................28

    I. 1. Drupal 7 ................................. 34

    : ...........................................34.............................................................................................................38 ................................................................................ 43 ...................................................................................................... 55

    2. : Drush Git.....................................56 Drush......................................................................... 57Git: ................................................................................ 62 ............................................................................. 67...................................................... ......................................................67

    II. 3.

    Views.............................................................................70 Views?..................................................................................................... 70 ............................................................................ 73 ................................................................................... 76 ....................................................................86 ................................................................................ 94 ........................................98 .....................................................................................................101 ........................................................................................................ 101 ..................................................................................103

  • 8

    4. .......................................... 104 Drupal-...................................................104 , ......................................................................104 ........................................................................................ 105 - ............................................................................107 .......................................................................................................... 107 .................................................................................... 110 ....................................................................................... 110 .................................................................................... 114 ............................................................................................... 121

    5. Organic Groups...................................................... 122 Organic Groups................................ 122 Views Organic Modules ................................ 126 ...........................................................................128 Panels......................................................................130, .............................................................................. 133............................. ............................................................................. 134

    6. Drupal ...................................................... 135 Drupal................................................135 ............................................................................... 138........................................................................................................... 145

    7. Drupal............................................................. 146 .................................................................................... 146........................................................................................................... 147 ........................................................................................148 Drush............................................................................ 150 diff...............................................................151 ............................................................................................152 Drush......................................................... 154............................................................................................................155

    8. ............................................................. 156 ........................................................................ 156 ...................................................... ............................................163

  • 9

    ........................................................................168 ........................................................................................... 171 ...................................................................179 Resource........................................................................................ 180 ........................................................ 182 , .............................185 Status.................................................................. 187 URL- Pathauto............ ......................189......................................................................................................... 190

    III. 9. Drupal-............................................................. 192

    ......................................................193 ...............................................................................................193........................................................................................................... 198

    10. .......................................... 200 .................................................................................................200 ................................................................................................. 201 ............................................................... 204 .................................................................................... 206 ...................................209 ............................................................... 212 ..................................................................................215

    11. .................................................................216

    ?............................................................... 216 .........................................................216 ...................................................217 .................................................................... 218 .....................................................220 .........................................................................221............................................................................................................221

    12. ............................................................. 222 Quickstart.................................................................................222 .........................................................................224

  • 10

    .................................................................................228...........................................................................................................236

    13. ..........................................................237

    .....................................................................................237 .....................................................................................242 ....................................................................244...........................................................................................................252

    14. .........................................................253 ................................................................................................. 253 .....................................................................................253 .......................................................................................254 ............................................................................................. 255

    IV. 15. ....................................................... .............................258

    .....................................................................................258 .....................................................................................262 ................................................................................................ 265 ............................................................................................. 269 ................................................................................................. 279 ..........................................................................................................286 .......................................................................... 289...........................................................................................................293

    16. ................... 294 .................................................................. 294 ......................................... 296Render API.............................................................................................................. 303 render(), hide() show()....................................................................... 308 .....................................................................................310CSS-...........................................................................................................320 ..................................................................................326 ............................................... 329...........................................................................................................332

  • i i

    V. 17. ................................... 334

    ............................................. .......................................... 334 .............................................................................................347...........................................................................................................356

    18. API ..............................357 ........................................................................................357 t() format_plural()..................................360 ........................................................................................ 361 hook_menu() ......................................368 ............................ 373 377 .............................................................................. 378 ........................ 379 ............................................................ 381 Drupal .................................................. 383 : CSS-....................... ........................385API .................................................................................................... 387 ................. ........................................400 ........................................................................................404...........................................................................................................405

    19. ............................................................406 ............................................406 ........................................................................... 412 ................................................................................ 414 ...........................................418 ..............................................................................................419.......................................................................................................... 425

    20. Drupal 7 .......................................426 ................................................................................. 426 ...................................................................................... 429 Drupal.org........................................................ 438

  • 12

    21. ..................440 ....................................................................................... 440 ........................................................................................................................ 441.....................................................................................................................442 .....................................................................445 jQuery UI............................................................................................448 ...................................................449........................................................................................................... 453

    22. Simpletest.......................... 454

    Simpletest....................................................................................... 455 Simpletest................................................................. 455 ................................................................. 456 Simpletest....................................................................................... 456 .................................................................................... 457 .test........................... ............................................................... 458 ............................................................................462Simpletests ........................................................................................... 464API Simpletest ...................................................... 465 Drupal.org ................................................466........................................................................................................... 467

    23. .......................................... 468 ............................................................................469 Drupal-...........................................................470 API?..................................................... 471 .........................................................................472 ....................................................................... 474 .....................................................................................................476 ........................................................................................ 482 ........................................................................................... 484 .............................................. 490 .....................................................................493 ............................................................................................495

  • 13

    VI. 24. Drupal Commerce................................................. 498

    Drupal Commerce .....................................................................498 ...............................................................498 Drupal Commerce.......................................................................499 Drupal Commerce........................................................................... 517 ........................................................................................... 518 Drupal 7 ..........................................................................................520...........................................................................................................525

    25. Drush............................................................. 526 Drush........................................................................................527 Drush ...............................................................533 Drush.....................................................................536 Drush .........................................538 Drush ..................................................... 540 Drush.......................................................................547 Drush........................................................................................556...........................................................................................................563

    26. Drupal............................................... 564 ?.................................................. 564......................................................................................................................... 565 memcached .....................................................................................567 Varnish.............................................................................................. 568 ........................................................... ..............................................568 MongoDB........................................................................................575................................................................. ......................................580

    27. Drupal........................................ 581 Drupal ...................................................................581 ........................................................................... 585 ..........................................................................................590 ..................................................... 592...........................................................................................................594

  • 14

    28. Drupal............ 595............................................................................................................... 595 .................................................................................601.......................................................................................................... 607

    29. Apache Solr Search Integration...........608API Search................................................................................................612 Apache Solr Search..............................................614 Apache Solr Search............................................................. 616 Apache Solr.................................................................618.......................................................................................................... 619

    30. : 90 % .......................... 620 .....................................................................620 .....................................................................................623 ..................................................... 626 Drupal.org Twitter .................................................................................... 629 CSS.................................. 637 Add New .........................................638 .................................................. 642 Next Previous, ........................... 665 URL-........................ 671........................................................................................................... 671

    31. Drupal .. 673 ................................................................................................. 673 ..................................................................675 : Features.................................................... 680 ........................................................................................... 685 ................................................................................................... 686...........................................................................................................687

  • Drupal- ...

  • Drupal . , , .

    . Drupal , . .

    , . Drupal j Query, . Drupal, , , , . Drupal , Git, . , Drupal; , , .

    , Drupal-. , , Drupal 7, . !

    (webchick), Drupal 7

  • Drupal?

    Drupal , - . , , , , , , , , , , , .

    . 1 . Drupal-

    CMS

    , Drupal... ! 43folders.com

    Drupal (Content Management System, CMS): ; ; ; , , ; . , .

    Views ( 3) . Groups ( 5) . Drupal Commerce ( 24) -. Drupal, ( 4).

  • 1 8

    Drupal , (. 15 16), ( 25) ( 29), , - . ( 17 23) . ( 9 , Drupal, .)

    Drupal JavaScript ( JQuery), , MariaDB/MySQL PostgreSQL. , , Drupal, . ? Drupal , . . Drupal , .

    , . [...] , , , CMS. . , , , Drupal.

    Drupal

    , Drupal , .

    Drupal , , , CMS: -. (Application Programming Interface, API) , Drupal CMS.

    Drupal , Facebook - (nysenate.gov/mobile, data.gov. uk, zagat.com), (buzzr.com). Drupal CMS , Java Flash AJAX.

    CMS Drupal-, . Open Atrium (openatrium.com) , Drupal Commons (drupalcommons.com) , OpenPublish (openpublishapp. com) OpenScholar (scholar.harvard.edu) . ( , , 31.)

  • Drupal? 1 9

    Drupal

    , , .

    -

    , - . . , , . Drupal, Drupal (Resource Description Framework, RDF).

    RDF , , . Drupal , , , , .

    Drupal Drupal , , , , . (, , , .) Drupal .

    , Drupal. , , . , Drupal Drupal .

    , Drupal, , . .

    Drupal Drupal Con - 2010 :

    , , . , Drupal- . ? , . 101, , . , Drupal, , .

  • 20

    Drupalcon? . . Drupal? , Acquia. , : ! Drupal Gardens! Drupal! Dries! . . Drupal ,

    , , , , . , Drupal-.

    Drupal ... ... ,

    (buytaert.net). ... (webchick.net),

    Drupal 7 , , , .

    ... , , -, , , , , , , Drupal (drupalcon.org).

    ... , 145- , CMS, , (thenation.com).

    ... 35 (scottbrown.com). ... - (starswithstripes.org). ... (sba.gov, whitehouse.gov ). ... - (libcom.org). ... 50 ,

    (teslamotors.com)., ... (lxDA.org). ... (robinwilliams.com chrisrock.com). ... (examiner.com)

    (, bolivia.indymedia.org tc.indymedia.org). ... ,

    Drupal 7 (drupalgardens.com). ... , Drupal,

    (angrydonuts.com), ( , ), (angrylittletree.com) Drupal , (palantetech.com). Drupal. . Drupal .

    D r u p a l 7

    , Drupal ; . , Drupal 6

  • Drupal 7 21

    , a Drupal 7 . .

    , , Drupal, , . Drupal- .

    , , (. 2).

    . , . . .

    . 2. Drupal 7, (1), (2) (3)

    . . . + () - () , , . (, Blocks) ( , ).

    Definitive Guide to Drupal 7Wht8'& New in Drupal

    "iffinmistratEdit view Configure block

    Toolbar Shortcut toolbar

    Contextual linksContextual links provide one-click navigation to content editing screens. They also help Drupal newcomers figure that this content was created in

    orthat content is a block, a menu, etc.

    ToolbarAdimnistrative toolbar provides quick access key functionality, \ Delete improved grouping of functionalityie, a direct link to the Modules ipage.

    Dashboard Content Structure Appearance People Modules Configuration Reports Kelp

    Add content Find content Bartik settings Menus Management menu Add user Blocks

    Hello 007 Log out

    Edit shortcuts

  • 22

    , , , , . .

    . , , , . . . , Drupal, , . , . Drupal 7 , Drupal . Drupal ,

    . Dashboard , , , / Drupal (. 3).

    A Dashboard Content Structure Appearance People Modules Configuration Reports Help Hello 007 i og out

    Add content Find content S2 Site Administrator Edit shortcuts

    Home * Adrrtimstration

    Dashboard

    Customize dashboard

    Recent content

    Duis Metuo Quia Torqueo new, edit deleteAnonymous (not verified)

    Antehabeo Ittum Vento -new edit deteteAnonymous {not verified)

    Mora

    Recent blog posts

    * Acsi GHvus incassuro imputo Obruo Nunc Pec us Proprius

    ju s Nobis Paratus* u tudus iuptaturn Nunc

    More ;

    . 3. Dashboard ,

    ,

    Drupal 7 , , , . . .

    Who's new

    * 00?

    Most recent poll

    (empty)

  • Drupal 7 23

    Drupal 7. . D7CX, , Drupal , .

    Drupal 7 , MariaDB 5.1.44 , MySQL 5.0.15 , PostgreSQL 8.3 SQLite 3.x. .

    Drupal 7 , , , JavaScript CSS, . Drupal 7 5.2.4 . -.

    7 , Drupal 7 .

    Drupal 7 . , (. 4). , .

    Modules *>

    I Home * Administration Modules IYou can find m odules and them es on dru p af.org . The following file extensions are supported: tar tgz gz bz2 . j

    Install from a URL|httpyynp.cK-upalcK-^fHes/projects/ctoots-?.*-1.0-atpba2.tar. \

    For example; http://ftp.drupai.org/files/projects/name.tar.gz

    Or

    Upload a module or theme archive to install( Choose R ie J No chosenFor example: name.mgz from your local computer

    Install

    . 4. Drupal

    Drupal , : - Bartik. Drupal 7,

    , CSS- (. 5).

  • 24

    Home | Guidne

    Etiam est risus

    Maecenas id porttitor Ut enim ad minim veniam, quis nostradfeiis. Laboris nisi ut aliquip ex ea.

    Lorem ipsum dolorSit amet, consectetur adipisidng elit, sed do eiusmod tempo r mddidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exerdtation uOamco laboris nisi ut aliquip ex ea commodo consequat. Maecenas id porttitor Ut enim ad minim veniam, quis nostr udfelis.

    ETIA M vsv tusus

    Dotsec placerst

    MasoffiBis id 'porttitor Ut enim adNuibwn nsbh defer

    minim veniam, quis uostrudfebs.

    Labor* nisi ut aiiquip e*. land it sed

    Fermestum id

    . 5. Drupal 7 Bartik

    Seven. , . Stark. ,

    . , , ., -

    , . 6. Bartik 15 . Seven , .

    . 6. Bartik Seven

    Drupal 7 . ,

  • 25

    .

    , , . , , .

    RDFa RDFa HTML , , . , .

    RDFa w3.org/TR/xhtml-rdfa-scenarios/.

    Drupal 7 , , : (

    ). cron.php (

    , , example.com/ cron.php, , , ).

    , . Filter . FileField. Test ( Simpletest)

    Drupal. . 22. , Drupal 7.

    drupal.org/about/new-in-drupal-7 drupal.org/drupal- 7-released.

    : 106 , , , , . : .

    , 1980

    Drupal 7! , Drupal, Drupal 7 . , Drupal , . : , , .

    Drupal, : ,

    .

  • 26

    Drupal-. . , Drupal. Drupal-

    .

    Drupal? ! , 1 Drupal . , . 9.

    ? , , Drupal . . Drupal , Drupal-.

    Drupal . , , .

    Drupal , , , Drupal. : , ,

    , , . ., , .

    , , Drupal. , , , . .

    Drupal . , . , . , Drupal .

    , , . Drupal-. Drupal, , .

    , Drupal 7 . , .

    Drupal :

  • 27

    ; .

    , -, , VirtualBox Drupal, drupal. org/project/quickstart. , Drupal, 12.

    , . . , .

    Drupal . . , . , . Drupal.

    , . - , . , , . , .

    , , , . , . , - , 9, .

    Drupal 7 . (? , -.) , Drupal. , , Drupal. .

    , , (user). Drupal 7 (people), , , , , , .

    Drupal (node). ? , ; ( , , ).

    , . , , ,

  • 28

    , . , , , , Drupal.

    , . , (definitivedrupal.org/forums dgd7.org/fora). , ( ).

    URL/ ( Drupal, , admin/content). , , , , : Administer Help (admin/help).

    URL- ( example.com URL- http://example.com/admin/people/ permissions/roles ).

    , , Drupal.

    definitivedrupal.org ( dgd7.org). dgd7.org/code. , . , . , , . Drupal, , . 9.

    , . Drupal , Drupal . , . dgd7.org/updates , , . [email protected].

    ~ Drupal ( ; ; ), , Drupal-.

    Drupal

    Drupal, . , Drupal, .

  • Drupal 29

    DrupalDrupal, WordPress (wordpress.org) Expression Engine (expressionengine.com), (Content Management System, CMS). Drupal , .

    Drupal Drupal . , (5 ., 10 . . .). , , , . (views) ; (pages) (blocks) , , . (themes) (modules) ; , , (. 7).

    . 7. Drupal

    Drupal : . WordPress,

    , Drupal , . , .

    , , Drupal . #Drupal, , . 9.

    , (node) . ,

    , , . , , . , .

    (field) Drupal. , (, ), .

    (block) , ( , ). (. ) Blocks. . ,

  • 30

    , .

    (content type) . Drupal , .

    (taxonomy) . (, ), . , (, . .), ( ), (, , . .). .

    (users), (roles) (permissions). , , . . Drupal , , , . , author (), , , . editor () .

    (module) , . Drupal , . drupal.org/project/modules. . Drupal Views, Pathauto Token. URL- . 3 8, , .

    (view) , Views. 3.

    (theme) , . Drupal , . sites/all/themes, .

    tpl.php -, Drupal . Drupal, , , , tpl.php. , , .

    Drupal (D ru p a l Core) Drupal-npoeKTa , Drupal.org. , /sites. , , 15 16.

    Drupal-npoeicra Drupal ,

  • Drupal 3 1

    . Drupal , , , .

    Drupal. 10.

    1. , . , , , . ; , .

    , . , Drupal, - .

    : ? ? ? ( ) ?

    ? ? , ? ? ?

    , ? ? ,

    ? ?

    2. , ; , , .

    , : . . . . -, ,

    . (, . .) , , . . ,

    , . , , , , , .

  • 32

    3. , Drupal. / . . .

    , ( 4), , , . . , .

    4. Drupal . , . Drupal ; ( ) .

    . , , , , , . . , Fireworks Photoshop.

    HTML, CSS . , . , .

    5. , . 13, :1. .2. URL- (,

    URL-, staging.newsite.com) .3. .4. .5. .6.

    URL-.7. .8. .9. .

    10. !, , ,

    Drupal.

  • I. 1 Drupal, . , Drupal, . 8 30.

    2 Drupal : Drush , ; Git , .

  • 1. Drupal 7

    ,

    , Drupal.

    (kombucha)

    Drupal 7: , , , Drupal-.

    . . Views, , , , JQuery; , Commerce.

    Drupal . , , Drupal, . Drupal. ( , 8, .)

    , , . . , , ! : . Drupal 7. Drupal, ,

    , . (

    ) .

    . , !

    : , . . ( 9.)

    : ? , , , . . , 9.

  • : 35

    , . . , , .

    , , ( ) , Drupal 7 , , Drupal.

    , DefinitiveDrupal.org ( DGD7) : t Drupal. , . Drupal .

    Drupal . , ,

    , , , . , . , . , . ( , , , .) , , .

    . ? , , , , .

    : ? . . . , . .

    , . , , , . , .

    , , , . . DGD7

  • 36 1. Drupal 7

    . -: .

    - ? , . . , .

    , Drupal, , Drupal . , . , . . , . Drupal , , . , , .

    : .

    . ,

    .

    . ,

    , , Drupal, , .

    .

    .

    ( ), . ,

    . ( .)

    , (. 1.1). , , , , . , , , , .

    . Drupal , , , , . .

  • : 37

    . , .

    -Vo

    *7

    AHACO+vUUiyUiAs

    H&SoCMAsI 4'

    % z 3

    . 1.1 .

    Drupal, , , , , , .

    , Drupal . Drupal ( ) , , , , . . , ( 6). , ( ) . , , ; , .

    DGD7 , , Apress. 15 16, , . , , , .

    Drupal , . , .

  • 38 1. Drupal 7

    , , , (. 1.2).

    IMAGE

    This is the mission .statement text area. This is the mission statement text area. This is the mission statement text area The mission statement text area is this area right here.This is the mission statement text area. This is

    -the mis'sion statement text^rea . This is the mission statement text area. This is the mission statement text area.

    UST- List item 1- List item 2- List item 3 -lis titem 4

    UST- List item 1- List item 2 * List item 3- List item 4

    UST| List item 1 * List item 2- List item 3- List item 4

    . 1.2. DGD7. HTML- , (

    , )

    , , Drupal , .

    , . . , Drupal . , , : : ,

    ( ). : , . : ,

    ., , (

    12).

    , . .

  • 39

    Drupal , Drupal. (Linux, Windows, Mac OS X), - (Apache, IIS, Nginx) (MariaDB/MySQL, PostgreSQL, SQLite).

    Drupal Drupal.org . http://drupal.org/project/drupal, . 1.3, Drupal. , , Drupal 7.

    Drupal core [ drupal.org - Moziila Firefox

    BSe Edit yiew History gookmarits loois

    0 v X- ! ij> http7/drupal .orq/orojeci/ftlrupe! v] :> | | f v

    Download & Extend Home Drupal Core : M odife- Themos . / installation ftoS tes

    Poshed by Drupat on S*pttmbet7$. 3003 & JGet started by downloading the official Drupa! core fiies, These officias releases come bundled with a variety oi moduies and them es to give you a good starting point to he*p buHd y o u rs i Onjpal core includes basic community features Sifce blogging. forums, and contact forms, and can be easily extended by downloading other contributed modules and themes.

    n version number* can be found in th e online itoonn

    Drupa! 7 is offictaiiy released!Come coiefetate the w o s s s i

    Dow nload*tar.gz 0.6 was j & |:w Caf,* issue*.

    _ j | ViSearch iAdvanced sow ch

    AS; issues9182 open,

    B o g reports , total

    oidostopenissuw: SSVb92Recent issues?h#mex Imprepwrfy check render * wrti&ri determining visibility

    , 1 .3 . Drupal-npoeiaa

    - (. dgd7. org/install). Drupal- index.php .htaccess Drupal .

    ( dgd7) Drupal ( dgd7/web). , , , (. 2).

    Drupal sites/default/default.settings. php sites/default/settings.php ( , ).

  • 40 1. Drupal 7

    Drupal settings.php. sites/default/files -. dgd7.org/install.

    , . , . , , Drupal.

    Drupal ( ). Ubuntu DGD7 http://dgd7.localhost; WAMP, LAMP http://localhost/dgd7/web. Drupal install.php.

    . ( .) ; , drupal.org/localize ( Drupal, drupal.org/project/HOn_install).

    (, ). SQLite Drupal, , -. Drupal SQLite. ( SQLite , , .) , Drupal !

    . 1.4 . Drupal

  • 41

    ( ) , ( ).

    . . . , , 6, . .

    , Drupal! . , Drupal 7 , , . 1.4. , .

    Drupal . 1.5 Drupal . Toolbar, . : . , . , . , . , . . . .

    ? Dashbo;3rd Content *

    Struetune Appearance People Modules Configuration Reports Help

    Add content Bnd content

    . 1 .5 . Drupal 7

    . Drupal Dashboard, , . .

    Shortcut , . Configuration User interface Shortcuts (admin/config/user- interface/shortcut). Shortcuts ( ID 7 user/7/shortcuts). , . People Permissions (admin/people/permissions)

  • 42 1. Drupal 7

    Select any shortcut set. ( .) , Use the administration toolbar; , .

    , (admin/help/shortcut). , http://drupal. org/documentat ion/modules /shortcut.

    Drupal. DGD7 , - , Apress. , , Appearance (admin/appearance). , , , 15.

    Drupal . drupal.org/project/ themes , 7.x. , Corolla (drupal.org/project/corolla), Drupal 7, , .

    Bartik, Drupal 7 , Color. , (. 1.6). Settings. Color set Slate, ( Bartik, Drupal- ).

    . 1 .6 . Bartik

    , , , . 15 ,

  • 43

    . Bartik, , .

    Color . . , , .

    Drupal. , , Drupal. , . Drupal.org (. 4). , ( , , ). . , Modules (admin/modules).

    OpenID, , . 1.7, Save .

    3 OpenID 7.0 Allows users to log into your site using OpeniO.

    . 1 .7 . OpenID admin/modules

    ( , ) Core . . ( Ctrl+F Command+F).

    OpenID OpenID. OpenID , . Google, Yahoo!, Livejournal, Wordpress.com, MayFirst.org AOL.com -; OpenID, MyOpenID.com Yiid.com, . openid.net. OpenID- , drupal.org/project/openid_provider.

    , ( Captcha, Mollom Antispam 4), ( , ). .

  • 44 1. Drupal 7

    Drupal , , , , . , . Color Overlay.

    Bartik, . Overlay . Modules (admin/ modules) Save configuration .

    Overlay? (, node/add/page) More information about text formats , . , Firefox, . , , . . Ctrl+Shift+T. Overlay , . ( drupal.org/node/655388. fixed for Drupal 7 , Drupal.) Overlay, . , Appearance (admin/appearance). Overlay (, user/86/edit).

    Drupal . Drupal . , . , , , , .

    , , ( ) . body ( ), , . , , file, image, listing option, . .

    Suggestion , . Suggestion . ( , , . .), . ( , .)

    Suggestion Structure Content types. Add content type.

  • 45

    , , . . , , Add content type, , admin/structure/types/add.

    Suggestion Description . (node/add) . , Submission form settings, , . . , . Save and Add Fields.

    Suggestion ; Comment , . , , . Comment settings, / .

    Manage fields , . 1.8. , , , . (Drupal .) : title body. , , title .

    A Dashboard Content Structure Appearance People Modules Configuration Reports

    Add content Find content

    Kelp Heilo admin Log out

    Edit shortcuts

    Home * Adm inistrate Structure Content types, * Suggestion

    S u ggestion manage fields m anaged _

    ^ The content type Suggestion has been added.

    Show row weights

    LABEL NAME REID WIOCET OPERATIONS

    * Title

    4* Body

    ^ Add new field

    title Node module element

    body Long text and summary Text area, with a summary edit delete

    ExplanationLabe!

    ; Add existing field

    fields explanation Long text j

    Reid name (a~z* 0-9, J Type of data to store.

    1 Text area {muitipte rows.) %Form siemens m edrt the data.

    Label

    f - Select m existing fieid - $Field to share

    Setect a widget - : % Form eiennent to edit the data.

    Save

    . 1.8 . Explanation. field explanation ( field_ )

  • 46 1. Drupal 7

    , , Explanation. Label Add new field , Long text. Label ; Drupal. long text ; text .

    Drupal. , . , , . , 15 16.

    Save , Save field settings, long text . ( , , Drupal 8; drupal.org/node/552604.)

    , . 1.9, . , Required field. , . Help text , Explanation. Rows 3, , . Text processing Plain text, . ( Plain text Filtered text .) Number of values ( , !) Save settings. .

    SUGGESTION SETTINGS

    These settings apply only to the Explanation field when used in the Suggestion type.

    Label *

    Explanation

    Q Required field

    Help text

    Optional background or rationale on why the above text should go in the Definitive Guide to Drupal.

    instructions to present to the user below this field on the editing form.Allowed HTML tags

    Rows *

    S Z I Z Z I Z Z Text processing

    Plain text

    Filtered text (user selects text format)

    . 1 .9 . long text

  • 47

    Drupal, , .

    URL- . . , . , . Basic page, Drupal . Add content Basic page (node/add/page).

    DRUPAL 7 Add content ( Drupal 6 Create content) , . , , Content.

    Title Drupal 7, Body -. , Text format Full HTML

    Provide a menu link, . 1.10: Menu link title , Description , . , 5 Weight, . !

    M enu settings; Buy the Book

    Provide a menu link

    Book outline Menu link title

    1..... .... ............................. :Revision Inform ation

    Buy the Book

    : Nerw revision Description

    URL path settings Purchasing the Definitive Guide to Drupal 7.

    ; Alias: purchase

    Com m ent se ttings ; Shown when hovering over the menu link.

    \ ClosedParent Item

    Authoring Inform ation | cMain menu> i By -' on

    Weighti i

    i Menu links with smaller weights are displayed btfore finks with larger weights

    ; 2010-07-0? 06:36:03 -0400

    Publishing op tions| Published

    . 1.10.

    URL- ( , , node/1). URL path settings URL alias purchase. . 1.10 .

  • 48 1. Drupal 7

    . 1.10 , Revision information New revision. , . 4 , Content Type Overview.

    , .

    , . Add content, Title Body. Publishing options Promoted to front page Sticky at top of lists, . 1.11. . , ( ).

    Submission form settingsDefault options

    Publishing options PublishedDisplay setting's Q Promoted to front pageComment strttfngs o Sticky at top of listsOpen. Tftttssrfing . 50 sor>iswji>ts jwjr page

    Create new revisionMenu settings

    Users with the Administer content permission wtli be able to override these options.

    . 1 .11 .

    Drupal ?, Promoted to front page . , , . Drupal, Content (admin/content).

    : , . . . Drupal 7 ; , Structure Blocks (admin/structure/block). , . ( , , ).

    . . Blocks Add block. Block description Mission statement ( ). Block title , Block body , . 1.12.

  • 49

    Block description *Mission statement

    A brief description of your block. Used on the Blocks administration page.

    Block title

    The title of the block as shown to the user.

    Block body *The Definitive Guide to Drupal 7 accelerates people along the Drupal learning curve by covering all aspects of building

    web sites with Drupal: architecture and configuration; module development; front end development; running projects

    sustainably; and contributing to Dnjpal's code, documentation, and community.

    . 1 .12 . / ( ) admin/structure/block/add

    DRUPAL 7 Drupal 4.0, 2002 , (General settings). Drupal 7 .

    , Region settings, Highlighted; Bartik . Visibility Pages, Show block on specific pages Only the listed pages. , . 1.13. Save block.

    Visibility settings

    Pagesi Restricted to certain pages Show block on specific pages

    All pages except those listed

    % Only the listed pagesContent types Not restricted

    Roles; Not restricted

    UsersNot customizable

    Specify pages by using their paths. Enter one path per Hne, The character is a wildcard, Example paths are btog for the blog page and /* for every personal blog, is the front page.

    Save block

    . 1 .13 . Mission Statement

    , .

    Drupal , . , , , , , .

  • 50 1. Drupal 7

    DGD7 , , . 1.14. Recent content Recent comments Sidebar first ( , . 1.15) .

    The Definitive Guide to Drupal 7 accelerates people along the Drupal learning curve by covering all aspects of building web sites with Drupal: architecture and configuration; module development; front end development; running projects sustainably; and contributing to Drupals code, documentation, and community.

    The Definitive Guide?"Definitive" is quite a claim to make. Not everyone who works in Drupal is good at all of it, or even can know about all of it Which is fantastic news for us, the readers and users of this book.

    No one expert in all areas, and so there are many onramps and avenues to becoming a Drupal expert. This multi-author book gives many of these at the same time as providing an essential overview. Together, we will learn how to think about and approach Drupal 7 and future releases.

    . 1 .14. , Mission Statement

    / l \ * The changes to these blocks wilt not be saved until the Save blocks button is clicked.

    'BLOCK REGION OPERATIONS

    Header

    No blocks in this region

    Help

    ; System help *> ............z i configure

    Highlighted

    i 4 Mission statement Hkjhtighted configure delete

    Featured

    No blocks in this region

    Content

    4* Main page content Content jji configure

    Sidebar first

    4* Recent comments* Sidebar first configure

    Recent contem Sidebar first configure i]

    . 1 .15. Recent comments Sidebar first,

    , . , , . None Disabled.

    Recent comments

    There's a drush command for that! months l week ago

    There are some who say that 2 months i week ago

    Putting the site online 4 months weeks ago

    Additional background 7 months l week ago

    Recent content

    Disabling Overlay Module Benjamin

  • 51

    : Drupal Taxonomy. ( ) . , , , , , (free tagging). , . ; , .

    . taxonomy/ term/8, 8 . , , . , . ( 3 Views). , , , , .

    , , Drupal . Suggestion; , .

    Structure Taxonomy (admin/structure/taxonomy) Add vocabulary . , Book element. edit element, . 1.16. Description, , , Content or concepts in, or suggested for, the book ( ). .

    Name *Book element

    Machine-readable name *element

    A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.

    DescriptionContent or concepts in (or suggested for) the book.

    Save

    . 1 .16 . Book element Taxonomy

    , Add term. :

    AlexHighlight

  • 52 1. Drupal 7

    Tip (); Note (); Gotcha (); Caution (); Reality (); New in Drupal 7 (); Concept (); Anecdote ().

    Status : Dont waste pixels on it ( ); If theres room ( ); Slated to go in ( ); Already in the book ( ).

    Suggestion . , , , Title Body.

    Structure Content types. Manage fields Suggestion. Add new field Label Book element, Field name element, Term reference. . Check boxes/radio buttons, . 1.17. Save.

    ** Add new field

    Book element) fie!d_ dement Term reference ^ | Check boxes/radio buttons dLabef Reid name (a-z, 0-9, J ' Type of data to store. Form element to edit the data.

    . 1 .17 . Term reference

    Number of values Check boxes/radio buttons , . 2 .

    , , Book elements Save field settings. Required field .

    Drupal 7 . , , Location , , .

    Status Suggestion, , Required field.

    , , Add content ( ) Suggestion. . , . !

  • 53

    , Structure Contenttypes Manage Suggestion Fields (admin/structure/types/manage/suggestion/fields), . ( Display fields). Save.

    , DGD7, . ? Drupal .

    , Drupal . . Drupal , .

    Drupal 7 people (). , , - user (). (user settings).

    Drupal : (anonymous user) ,

    . (authenticated user) ,

    . (administrator)

    . ; Drupal.

    , . , Drupal, . , Configuration People Account settings (admin/config/people/accounts).

    , . , , . , , , , editor .

    , . , , , . , . , .

    DGD7 , .

  • 54 1. Drupal 7

    . . , .

    . People Permissions Roles (admin/people/permissions/roles). , , author Add role, . 1.18.

    NAME OPERATIONS

    4. anonymous user docked)

    : * authenticated user docked)

    ; ' administrator

    autborj Add roie

    edit permissions

    edit permissions

    edit role edit permissions

    . 1 .18 . .

    , Drupal , , . , . admin/config/people/accounts, admin/people/create.

    DGD7 , Status , . 8 Field Permissions, : , Status .

    Edit permissions . , Permissions. , . , author, . , .

    , , , Taxonomy, Status. : Access the content overview page ( ). Create new Basic page content ( ). Edit own Basic page content ( ). Edit any Basic page content ( ). Create new Suggestion content ( ). Edit own Suggestion content ( ). Edit any Suggestion content ( ). Use the administration pages and help ( ). Use the administration toolbar ( ).

    , author , . People .

  • 55

    Add user. . , Drupal , . (, , , , ; , , 12.)

    . Update options, . 1.19.

    UPDATE OPTIONS

    Unblock the selected users M| Update! Unblock the selected users I Block the selected users J Cancel the selected user accounts (A dd a role to the selected users 1 administrator

    ROLES

    author 1IRemove a rote from the selected usersI administrator i author

    je administrator

    . 1 .19. author

    , Drupal 7! , Drupal , . Drupal, . .

    , : Drupal 7 . . Mission

    Statement . , . ,

    .

    Drush Git, Drupal . ( 12, .) 3 Drupal Views. 4 ( ) Drupal 7. . 8 DGD7.

    dgd7.org/firstsite.

  • 2. : Drush Git

    , .

    , Drupal, , Drush ( Drupal) Git ( ) . Drush Git , . Drush , 25.

    Drush? . ? drush up. ? drush dl _. Drush (. 2.1).

    Dani-Nordins-HacBook-Pro:*' Deni$ cd 0ropbox/MAHP/drupal7 Dani-Nordins-MacBook-Pro:drupal7 Danii drush up Refreshing update status information ...Done.Update information last refreshed: Fri, 01/21/2011 - 17:40

    Update status information on all installed and enabled Drupal projects:Name Installed Proposed Status

    version versionBackup 7.X-2.0 7.X-2.0 Up to dateandMigrateDrupal 7.0 7.0 Up to datecoreChaos 7.x-1.0-alph 7.x-1.0-alph Up to datetool 32 a2suitePathauto 7.x-1.0-alph 7.x-1.0-beta Update available

    a2 1Token 7.x-1.0-alph 7.x-1.0-beta Update available

    a3 1Views 7.X-3.0-alph 7.x-3.0-alph Up to date

    al alWysiwyg 7.X-2.0 7.X-2.0 Up to dateBoron 7.x-1.0-beta 7.x-1.0-beta Up to date(HTML5 1 1basetheme)NineSixt 7.x-l.x-dev 7.x-l.x-dev Update available (960GridSystem)

    Code updates will be made to the following projects: Pathauto [pathauto-7.x-1.0-betal], To ken [token-7.x-1.0-betal], NineSixty (960 Grid System) (ninesixty-7.x-l.x~devj

    . 2 .1 . Drupal drush up 30 , 15 ,

    Git . , (Version Control System, VCS), . , , : -

  • Drush 57

    , , ? . , . .

    , , VCS. , , Internet Explorer, . . , . Drush Git.

    Git , Drupal, , .

    DrushDrush , Drupal , . . Drupal Drush - . , , .

    . - .

    . Mac OSX Ubuntu

    . , Ubuntu Drupal.

    . Drush Git . Mac OSX Coda Panic ( www.panic.com/coda/), Terminal. , .

    , Drush, , ( Drupal). Drupal. Drush (. )

    . cd/path/to/drupal ( /path/to/drupal Drupal ). Drush- drush _.

  • 58 2. : Drush Git

    Drush- Drupal , ( sites/default); , c d /p a th /to /d ru p a l/s ite s / example.com -1 h t tp : / /exam ple. com.

    Drush Date. , cd Dropbox/MAMP/dgd7, Drupal ( ):

    Last login: Fri Jan 21 17:40:08 on ttys000 Dani-Nordins-HacBook-Pro:*' Dani$ cd Dropbox/MAMP/dgd7 Dani-Nordins~MacBook-Pro:dgd7 Dani$ drush dl dateProject date (7,x-1.0-alpha2) downloaded to /Users/Dani/Dropbox/HAHP/dgd7/sites/all/inodules/date.Project date contains 6 modules: date_views, date_tools, date_repeat, date_popup , date.api, date.Dani-Nordins-HacBook-Pro:dgd7 Oani$ drush pm-enable date The following extensions will be enabled: date_api, date Do you really want to continue? (y/n):

    Dani-Nordins-Hac8ook-Pro:dgd7 Dani$ |

    date was enabled successfully, date.api was enabled successfully.

    (Laura Scott) ; Drush. Mac OS X, Unix- .

    1. Drush Drush drupal.org/project/drush. Drush Drupal, , . 2.2. (Drush , !)

    Drush was originally developed by Arto for Drupal 4.7 (this alpha code can still be found in the DRUPAL -4 -7 branch). In May 2007, it was partly rewritten and redesigned for Drupal 5 byfrando. The module is now maintained by Moshe Wests man, Owen Barton, .Adrian Rossouw, greg.l.anderson, and jonhatian.

    Project Information

    Maintenance status: Actively maintained Development status: Under active developmentModule categories: DrushReported installs: 1284 sites currently report using this module. View usage statistics.Last modified: January 6, 201.1

    DownloadsRecommended releases

    Version Downloads

    All*-versions-4.1 tar.grAil~versions3 3 tar,gf

    Development releases

    Version Dow)

    Al I -v rs ion s - 3. x -dev tar.gi

    Date

    View ail releases

    Open Link in New Tab

    Open Link in New Window

    Open Link in Incognito Window

    Save Link As...

    Copy Link Address

    Inspect Element

    SOHO Notes Open

    links

    n-ll Notes|g ~ l l Notes

    Links

    *9-1 Notes

    . 2 .2 . Drush-. Recommended releases

  • Drush 59

    tar , home. dev .

    . drush , README.txt. !

    , Terminal, tar.gz home, . 2.3. **.wget http://ftp.drupal.0rg/files/pr0jects/drush-7 .x-4 .4 .tar.gz;** Drush - wget **tar xzf drush-7.x-4.4.tar.gz;** **rm drush-7.x-4.4.tar.gz;** **

    D a n i -N o r d in s -M a c B o o k -P r o : - D a n i$ w g e t h t t p : / / f t p . d r u p a l . o r g / f i l e s / p r o j e c t s / d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g z 2 0 1 1 - 0 1 - 2 1 1 8 : 2 2 : 5 2 h t t p : / / f t p . d r u p a l . o r g / f i l e s / p r o 3 e c t s / d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g zR e s o lv in g f t p . d r u p a l . o r g . . . 6 4 . 5 0 . 2 3 3 . 1 0 0 , 6 4 . 5 0 . 2 3 6 . 5 2 C o n n e c tin g to f t p . d r u p a l . o r g | 6 4 . 5 0 . 2 3 3 . 1 0 0 | : 8 0 . . . c o n n e c te d .HTTP r e q u e s t s e n t , a w a i t in g r e s p o n s e . . . 2 0 0 OK L e n g th : 2 4 3 7 1 1 (2 3 8 K ) [ a p p l i c a t i o n / x - g z i p ]S a v in g t o : ' d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g z *

    1 0 0 % 2 4 3 , 7 1 1 9 7 3 K /S i n 0 .2 s

    2 0 1 1 - 0 1 - 2 1 1 8 : 2 2 : 5 2 (9 7 3 K B /s ) - ' d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g z ' s av ed [ 2 4 3 7 1 1 /2 4 3 7 1 1 ]

    D a n i-N o r d in s -M a c B o o k -P r o :* * D a n i i t a r x z f d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g z D a n i-N o r d in s -H a c B o o k -P r o :~ D a n i$ rm d r u s h - A l l - v e r s i o n s - 4 . 1 . t a r . g z O a n i- N o r d in s - H a c B o o k -P r o :^ D a n i$ |

    . 2.3. Drush . Drush

    2. Drush . , , Drush .

    . home, Finder.

    Drush , . chmod u+x /path/to/drush/drush ( /path/

    to/ Drush). Drush dev, , : chmod u+x dev/drush/drush

    , Drush , , drush (, , ).

    . , . bash Drush, .

  • 60 2. : Drush Git

    UNIX home :- ( ).

    bash home. , :

    cd ~

    bash , home, :Is -

    , , , . 2.4. (.); :.profile.bash_aliases.bashrc.bash_profile

    Dani-Nordins-MacBook-Pro Oani-Nordins-HacBook-P

    Dani$ cd - Dani$ Is -a

    .drush Documents

    .freemind Downloads.AB64CF89 .gem Dropbox.CFUserTextEncoding .gitconfig FontExplorer X.DS_Store .hAWabAzAr Library.Trash .htaccess Movies.adobe .realobjects Music.bash_history . rnd Pictures,bash_profile .ssh Public.crash_report_checksum .subversion Sites.crash_report_frames .viminfo drush.crash_report_preview .wdswlock drush-backups. cups Applications qtm-blog.dropbox Desktop Dani-Nordins-HacBook-Pro:*"' Dani$ |

    . 2 .4 . Is home

    bash . , , nano ( UNIX).

    ( . bash_prof ile). nano .

    : nano .bash_profile

    . . , , , : alias drush='/path/to/drush/drush'

    /path/to/ . home? , . 2.5. alias drush= Wdev/drush/drush'

    Jxport PATH=$PATH:/Users/Dani/drush

    Get W n t e O a g Read Fffl Prev Cut Cur Pos I Exit J u s t i f y Where Next PgQ UnCut gy To Spell

    . 2 .5 . drush: drush PATH .bash_profile .profile

  • Drush 6 1

    , Ctrl+x, y(es) Enter. .

    bash source . : source .bash_profile

    4. . . :drush

    Drush-. ! (, , !) . 2.6.

    Dani-Nordins-MacBook-Pro:^ Oani$ cd Dropbox/MAMP/dgd7 Dani-Nordins-HacBook-Pro:dgd7 Dani$ drushExecute a drush command. Run 'drush help (command]' to view command-specific help. Run "drush topic' to read even more documentation.

    Global options (see 'drush -r , root=

    -I http://exanple.com, urihttp://example.com - V , verbose

    -d, debug

    -y, yes

    -n, no - 5 r simulate

    -p. pipe

    -h, help version php

    Core drush commands: cache-clear (cc) core-cli (cli) re-cron (cron)

    core-rsync (rsync) core-status (status, st)core-topic (topic) drupal-directory (dd) help

    image-flush php-eval (eval, ev)

    topic' for the full list):Drupal root directory to use (default: current directory)URI of the drupal site to use (only needed in multisite environments) Display extra information about the command.Display even more information, including internal messages.Assume yes* as answer to all promptsAssume 'no* as answer to all prompts Simulate all relevant actions (don't actually change the system)Emit a compact representation of the command for scripting.This help system.Show drush version.The absolute path to your PHP intepreter, if not 'php' in the path.

    (core)Clear a specific cache, or all drupal caches.Enter a new shell optimized for drush use.Run all cron hooks in all active modules for specified site.Rsync the Drupal tree to/from another server using ssh. Provides a birds-eye view of the current Drupal installation, if any.Read detailed documentation on a given topic.Return path to a given module/theme directory.

    Print this help message. See 'drush help help' for more options.Flush all derived images for a given style.Evaluate arbitrary php code after bootstrapping Drupal

    . 2.6. !

    , Drupal. , Drupal, : cd /path/to/drupal

    , - . drush dl . , Drush , . , - . drush up. Drush 25.

  • 62 2. : Drush Git

    Git: - . , , , . , .

    . 14 , ( ) .

    Git? . Git. , -, , , Drupal.org. , , Git. . Git Drupal-.

    The latest stable Git release is

    release notes (2011 m -os)

    Other OQwnjoad Ogtlgns&&

    Download Git

    $ g it clone g i t ; //g ithub.com /gH /hello-w orId .g it $ cd (p ro jec t-d irecto ry )$ cd hello-world $ git inft$ (edit files) $ (add some files)t git add (files) $ git add .$ g it eosmit -m 4Explain what I changed' $ g it commit -m I n i t ia l emit*$ g it fonsat-patch origin/m aster

    Windows MacOSX

    Git is...Git is a free A open source, distributed version controlsystem designed to handle everything from small to very large projects with speed and efficiency.

    Every Git is a futf-fiedged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.

    Git is used for version control of files, much like tools such as Mercurial. Bazaar. Subversion. CVS. Perforce, and

    Cloning and Creating a Patch

    Projects using Git

    * m* UaaJSsmfii

    KDE

    Qi

    PostgreSQL

    Debian

    X.orq

    Creating and Commiting

    . 2 .7 . Git. ,

  • Git: 63

    , (Distributed Version Control System, DVCS). , Drupal.org Bazaar Mecurial ( Bazaar). Drupal- Git.

    Git . , , gitscm.com. , , . 2.7.

    , UNIX- , . , Debian Ubuntu sudo apt-get install git. Mac OS X Homebrew (mxcl.github. com/homebrew) . Windows Git code.google.com/p/msysgit UNIX- Cygwin.

    Git . Git , , Applications. . ( Windows start Git-.) git. drush, (. 2.8).

    L a s t lo g in : F r i Jan 21 1 0 :4 8 :5 5 on c o n so le ,O a n i-N o rd in s -H a c B o o k -P ro :** D a n i$ g i tusage: g i t I v e r s io n ) [ e x e c -p a th [ < p a th > ] ] ( h tm l-p a th ]

    [_ p i p a g in a t e | n o -p a g e r) I n o -r e p la c e -o b je c ts ][ b a re ] I g i t - d i r * < p a t h > ) t w o rk - tre e = < p a th > ][ nam e=value] I h e lp ] [< a rg s > ]

    The most commonly used g i t commands a r e :add Add f i l e c o n te n ts to th e in d e xb is e c t F in d by b in a ry s e a rc h th e change th a t in tro d u c e d a bugbran ch L i s t , c r e a te , o r d e le te b ranchesch ec k o u t Checkout a b ranch o r p a th s to th e w o rk in g t r e ec lo n e C lone a r e p o s ito r y in t o a new d i r e c t o r ycommit Record changes to th e r e p o s ito r yd i f f Show changes betw een com m its, commit and w o rk in g t r e e , e tcfe tc h Download o b je c ts and r e fs from a n o th e r r e p o s ito r yg re p P r in t l in e s m a tch in g a p a t te r ni n i t C re a te an em pty g i t r e p o s ito r y o r r e i n i t i a l i z e an e x is t in g onelo g Show commit lo g smerge J o in two o r more deve lopm ent h is t o r i e s to g e th e rmy Hove o r rename a f i l e , a d i r e c t o r y , o r a s y m lin kp u l l F e tc h from and merge w ith a n o th e r r e p o s ito r y o r a lo c a l b ranchpush U pdate rem ote r e fs a lo n g w ith a s s o c ia te d o b je c tsre b as e F o r v a r d -p o r t lo c a l com m its to th e updated upstream headr e s e t R e se t c u r r e n t HEAD to th e s p e c i f ie d s t a term Remove f i l e s from th e w o rk in g t r e e and from th e in d e xshow Show v a r io u s ty p e s o f o b je c tss ta tu s Show th e w o rk in g t r e e s ta tu sta g C r e a te , l i s t , d e le te o r v e r i f y a ta g o b je c t s ig n ed w ith GPG

    See g i t h e lp ' f o r more in fo r m a t io n on a s p e c i f ic command. D a n i-N o rd in s -H a c B o o k -P ro :* ' D an i$ |

    . 2 .8 . git

  • 64 2. : Drush Git

    git git , ( File Quit, Cmd+Q) .

    GitGit . , . Git- Drupal. , . , , . , SmartGit, drupal. org/node/777182. Mac OS X Tower (git-tower.com).

    Git- dgd7.org/git.

    : , , :git config --global user.name "Your Name" git config --global user.email [email protected]

    .

    Git . - . g it in it . ( cd). .

    , - DGD7, 1. :cd ~/code/dgd7 git init

    Drupal- .git, . 2.9. .

    See git help ' for more information on a specific command.Dani-Nordins-MacBook-Pro:"' Dani$ cd -/Dropbox/MAMP Dani-Nordins-MacBook-Pro:MAMP Dani$ cd dgd7 Dani-Nordins-MacBook-Pro:dgd7 Dani$ git initInitialized empty Git repository in /Users/Dani/Dropbox/MAMP/dgd7/.git/ Dani-Nordins-MacBook-Pro:dgd7 Oani$ |

    . 2 .9 .

    , . ,

  • Git: 65

    , CSS- . , , . ( ) . , , .

    . git add . . Git, ( ) . , , git status (. 2.10).

    Dani-Nordins-HacBook-Pro:dgd7 Dani$ git add .Dani-Nordins-MacBook-Pro:dgd7 Dani$ git status# On branch master## Initial commit## Changes to be committed:# (use git rm cached ..." to unstage)

    new file: .htaccessnew file: CHANGEL0G.txtnew file: COPYRIGHT.txtnew file: INSTALL.mysql.txtnew file: INSTALL.pgsql.txtnew file: INSTALL.sqlite.txtnew file: INSTALL.txtnew file: LICENSE.txtnew file: MAINTAINERS.txtnew file: README.txtnew file: UPGRA0E.txtnew file: authorize.phpnew file: cron.phpnew file: includes/actions.incnew file: includes/ajax.incnew file: includes/archiver, incnew file: includes/authorize.incnew file: includes/batch.incnew file: includes/batch.queue.inc

    . 2 .1 0 . DGD7

    , . git commit, . 2.11. ; Git . , - . , , (, - DGD7). , :git add . git statusgit commit -m " "

    , . , ; Git .

    (. 14). , (, ) .

  • 66 2. : Drush Git

    0ani-Nordins-MacBook-Pro:dgd7 Dani$ flit commit -m "Initial commit of files for 0607 demo site** [master (root-commit) ddScSd4] Initial commit of files for 0G07 demo site 20S2 files changed. 461943 insertions(+), 0 deletions(-) create mode 108644 .htaccess create mode 100644 CHANGELOG.txt create mode 190644 COPYRIGHT.txt create mode 100644 INSTALL.mysql.txt create mode 100644 INSTALL.pgsql.txt create mode 100644 lNSTALL.sqlite.txt create mode 100644 INSTALL.txt create mode 100644 LIC0ISE.txt create mode 100644 MAINTAINERS.txt create mode 100644 README.txt create mode 100644 UPGRADE.txt create mode 100644 authorize.php create mode 100644 cron.php create mode 100644 includes/actions.inc create mode 100644 includes/ajax.inc create mode 100644 includes/archiver.inc create node 100644 includes/authorize.inc create mode 100644 includes/batch.inc create mode 100644 includes/batch.queue.inc create mode 100644 includes/bootstrap.inc create mode 100644 includes/cache-install.inc create mode 100644 includes/cache.inc create mode 100644 includes/common.inc create mode 100644 includes/database/database.inc create mode 100644 includes/database/log.inc create mode 100644 includes/database/mysql/database.inc create mode 100644 includes/database/mysql/install.inc create mode 100644 includes/database/mysql/query.inc create mode 100644 includes/database/mysql/schema.inc create mode 100644 includes/database/pgsql/database.inc create mode 100644 includes/database/pgsql/install.inc create mode 100644 includes/database/pgsql/query.inc create mode 100644 includes/database/pgsql/schema.inc create mode 100644 includes/database/pgsql/select.inc create mode 100644 includes/database/prefetch.inc

    . 2.11. DGD7

    GitGit . , , , , :git reset --hard HEAD

    , .

    , , : git checkout -- path/to/HNmaMa.php

    -php . , : git revert HEAD

    ( ) :git revert HEADA

    Git-, Git, , :

  • 67

    git status , .

    git log . , git log - -pretty=oneline. , git log --pretty=oneline -n5 , , . :q, .

    git checkout mymodule.info ( ). Git- man git.

    Git , . , , . Drupal ( ) , .

    Drupal Git Backup, github.com/scor/dgb, . 12.

    , Backup and Migrate (drupal.org/project/backup_migrate), , .

    Drush, drush sql-dump > /path/to/.sql

    . , Drush ; , . Drupal Git Backup, 25 , . , drush .

    , , ( !) . , , . .

    dgd7. org/essential.

  • II. 3 Drupal- Views. , .

    4 ( ), Drupal-, .

    5 Organic Groups, . Panels, , Views.

    6 , .

    7 Drupal.

    8 , 1, , , , . , Drupal, .

  • 3. Views

    Views . , - -, , , . . , , .

    Views , . . . Views, ; , ! Views .

    Views? , . (view) , . , .

    Views Drupal , . , , .

    Views (Earl Miles), drupal.org merlinofchaos. drupal.org/project/views , .

    , , . Views , .

    drupal.org/pwject/views

    Drupal, Views . . , , , .

    , Views . . , , .

    , Views, ,

  • Views? 71

    , , . , , , . Views , .

    Views Views: -; ; , , ; ; (. 3.1).

    Post date Published Title Type

    Sun, 01/10/2010 12 38 Yes Gemino Magna Pals Basic page

    Tue, 01/12/2010 -15:36 Yes Expiito M g s Si Sit Basic page

    Sun. 01/17/2010 -18:07 Yes Jus Mgs Mibh Basie page

    Mon, 01/18/2010 - 1 3 40 Yes Et Humo ibidem Lobortis Basic page

    Wed, 01/20/2010 - 06:15 Yes Altquam Camur Inure Turn Article

    Sat, 01/23/2010 -11:50 Yes Eum Ibidem Melior Vei Basic page

    Mon, 01/25/2010 -12:24 Yes Exputo Feugiat PaJa Article

    . 3.1 .

    , . , Views .

    , (page) (block). URL- , .

    9 Views , .

    drupal.org/project/views. Downloads, Recommend releases. , Drupal, 7.-3., (tar.gz zip).

    . sites/all/modules/contrib sites/all/modules. Views sites/all/modules/contrib/views sites/ all/modules/views. ( Drush, 2).

  • 72 3. Views

    , ( user/1). , admin Modules.

    Views. : Views, Views exporter Views UI. Views , CTools. , enabled. CTools, , disabled. , , missing. Drupal , , .

    , , CTools drupal.org/ project/ctools. ctools . /sites/all/modules, , CTools sites/all/modules/ctools.

    CTools (Chaos Tools Suite) .

    Modules (admin/modules) Refresh. Views. CTools disabled, . 3.2. Views. Views Views UI .

    - VIEWS

    ENABLED ; NAME I VERSION DESCRIPTION j OPERATIONS

    Views7

    Create customized lists and queries from your database.Requires: Chaos toots (disabled)Required by: Views content panes (disabled), Views exporter (disabled), Views UI (disabled)

    Viewsexporter

    7 Allows exporting multiple views at once. Requires: Views (disabled), Chaos tools (disabled)

    0 Views UI7 Administrative interface to views. Without this

    module, you cannot create or edit your views. Requires: Views (disabled). Chaos tools (disabled)

    . 3 .2 . . ,

    Views exporter .

    Views , Drupal :

    You must enable the Chaos tools module to install Views UI. Would you like to continue with the above? ( Views UI Chaos tools. , ?)Please Continue. (, )

  • 73

    Drupal (. 1 8). . (anonymous user), (authenticated user), , .

    . .

    Administrative People Permissions. Views. Views : Administer views Access all views.

    Permissions Views. Views .

    Administer views Views, , . , . Administer Administrator.

    Bypass views access control. , . , Access all views. , , , .

    , Authenticated User Anonymous User , Administrator . - , Save permissions.

    . , : , Firefox, Chrome, Internet Explorer. .

    ! Views . .

    Administration Structure Views (admin/structure/views). , .

  • 74 3. Views

    Advanced Help Advanced Help, , . 3.3.

    If you install the advanced help module from http://drupal.org/project/advanced.heiprViews will provide more and better help. Hide this message.

    . 3 .3 . , Advanced Help

    Advanced Help , . drupal.org/project/advanced_help Hide this message.

    Add new view Import . .

    . , . View Name, Tag Path. , .

    Settings . Show filters on the list of views Save.

    Search, , , . 3.1. 3 .1 .

    Tags ( ),

    Displays , : URL-, ,

    Types , : , ,

    Storage : , , ( )

    Status

    , Reset , (. 3.4).

    Search Reset

    Filter ; All tags - ; All displays \ All types - All storage \ All status j$;

    . 3 .4 .

  • 75

    Views , . . .

    (. 3.5).

    .1. ?

    , .

    (machine name).2. ?

    , , .

    .3. ?

    . , . , , , , internal.

    4. , , ? . , URL-

    . Drupal , . , http://www.example.com/archive, archive.

    5. ? . /

    Views. , . , .

    clone export, .

    , . Enable, , , , .

    1 6 2 3 4 5

    enable

    . 3 .5 .

  • 76 3. Views

    6. ? .

    , - ? . , - .

    7. ? . In code .

    . Database overriding code

    , . In database ,

    .8. ?

    , , , , . .

    , (admin/structure/views) . . 3.2 , Views. . , , , . .

    3 .2 . Views

    Archive ,

    Backlinks , ,

    Front page Drupal.

    ,

    Glossary Recent comments

    Taxonomy term Tracker ,

    Views . . , , .

    . Front page. Operations Enable. , Edit.

  • 77

    , . Edit. .

    , , , , .

    Disable. , . , .

    Clone. , . . . .

    Export. . , . .

    , , .

    Edit Front page, . 3.6.

    Front page Emulates the default Drupal front default frontpage, rss.xml edit * 'Displays. Feed, Page page; you may set the default home disableIn code page path to this view to make it cloneType: Content your front page.

    export 1

    . 3 .6 .

    Edit . Front page. . , . 3.7.

    D isplays

    1 ^*Add : edst nam e and description -

    analyze

    Page details done

    Display name: Pageexport

    . 3 .7 . (),

    Front page : () Feed (). +Add, . , .

    . clone export , . :

  • 78 3. Views

    Edit name and description. . 3.8 , , . . . Views , . , , , .

    View name and description

    Human-readable name _ __ ____Front page

    A descriptive hum an-readable name for this view Spaces are allowed

    View tag _ ______ _.default O;Enter an optional tag for this view, it is used only to help sort views on the administrative p age

    View description ________ _ _; Emulates the default Drupal front page; you may set the default hon;This description will a p p ear on the Views administrative Ul to tell you what the view is about

    Apply ^ Cancel

    . 3 .8 . ,

    Analyze. .

    . . 3.9 , , , . , . , , . , , .

    Page details

    Display name: Page clone page

    TITtE PAGE SETTINGS A dvan ced

    Title None Path: frontpage

    FORMAT Menu: No menu

    Format. Unformatted lisi ; Settings Access: None

    Show: Content ; Teaser HEADER dd

    FU.TER CRITERIA add - FOOTER add

    Content Promoted to front page (Yes) PACERContent: Published (Yes) Use pager: Full > Paged, 1 0 items> SORT CRTTERIA add

    Content: Siicky (desc)

    Content: Post date (desc)

    . 3 .9 .

  • 79

    , .

    Display Name, , .

    . : Name ().

    . , . , : , , , . block. , , Block: 5 recent (: 5 ) Block: 5 random (: 5 ).

    Description (). , .

    Title . , 1, . . Title . 3.10 : For .

    , This page (override). All displays (except overridden) .

    Title .

    Page: The title of this viewFor All displays (except overridden)^

    This title wtll be displayed with the view, wherever titles are normally