-
Notifications
You must be signed in to change notification settings - Fork 1
/
drupalsitebuilding.xml
2111 lines (2111 loc) · 112 KB
/
drupalsitebuilding.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "docbookx.dtd">
<book><!--Intro to Drupal -->
<bookinfo>
<title>Drupal Site Building - Drupal 7</title>
<author>
<othername>Winston</othername>
<personblurb><para><ulink url='http://drupal.org/user/50839'>http://drupal.org/user/50839</ulink></para></personblurb>
</author>
<author>
<othername>Alexander Ross</othername>
<personblurb>
<para><ulink url="http://drupal.org/user/50839">http://drupal.org/user/77375</ulink></para>
</personblurb>
</author>
</bookinfo>
<abstract>
<para>
This course covers how to build a site with Drupal. Site building here means
creating a site without programming or theming. Coverage include basic
post-installation, understanding of administrative functions of setting up a drupal
site, working with menus, using regions and blocks, installing and using core and
common contrib modules. Most importantly building your own content types with the
Content Construction Kit and
creating output for your pages with Views is covered in some detail. As an added
bonus we also include an example of improving your admin interface.
</para>
</abstract>
<!--Consider adding a preface-->
<chapter><!--Starting Point - Installing Drupal for the First Time -->
<chapterinfo>
<title>Drupal Environment</title>
</chapterinfo>
<abstract>
<para>
This chapter covers some background information about the environment in which
you run a Drupal site. We'll also define some information you'll need to
complete the rest of this course.
</para>
</abstract>
<section><!--AMP Underpinnings-->
<title>AMP Underpinnings</title>
<para>
The web server environment most commonly used to run Drupal (or any other PHP-based web application) is often referred to as <emphasis>LAMP</emphasis>, which is short for Linux, Apache, MySQL, and PHP. For this class, we will refer to this to AMP, as you will see you can install Apache, MySQL and PHP on Linux, Windows, or Mac computers. You will often hear this referred to as the AMP "stack". In this context, "stack" means a set of programs that work together to accomplish a task (serving up your PHP-based, data driven, Web site).
</para>
<para>
Here is a brief description of what these components do:
</para>
<variablelist>
<title>AMP Stack</title>
<varlistentry>
<term>Apache</term>
<listitem>
<para>
Apache is the most common web server in use on the Internet today. It accepts requests to your Web site from browsers such as Firefox, Internet Explorer, or Safari, and sends the resulting page content back to the browser. Other web server software can also be used for Drupal. NGINX in particular is becoming popular.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MySQL</term>
<listitem>
<para>
MySQL is an open source relational database program (RDBMS). This is the database most commonly used to store your Web site data. Drupal supports other databases as well. Postgres is another free option. Drupal 7 will include support for SQLite and other databases as well.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>PHP</term>
<listitem>
<para>
PHP: Hypertext Pre-Processor. PHP is simply the programming language that Drupal is developed in. It is a requirement to run Drupal. PHP is a scripting language which means that it is interpreted at "run time". However there are many possibly ways to optimize PHP applications. PHP based web applications power much of the internet.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section><!--Class AMP environment-->
<title>Class AMP environment</title>
<para>For the purpose of this class you'll need someplace to install Drupal to
perform the hands-on activities. We won't go into exact detail as there are a
few different ways this can be done. Your instructor will provide you with
details on how/where you'll be setting up Drupal for this class.</para>
<para>There are a few different possibilities here:</para>
<orderedlist>
<listitem>
<para>Local pre-configured AMP "stack": </para>
<para>Some local options include for example WAMP for Windows, MAMP for
Mac, and the Acquia Drupal Stack installer (both Windows and MAC).</para>
</listitem>
<listitem>
<para>Remote web server (managed with CPanel or similar)</para>
<para>These may be low cost shared hosting providers. Some may provide
command line access to the server, others may not.</para>
</listitem>
<listitem>
<para>Remote web server (with command line "ssh" access)</para>
<para>This could be cloud hosting, slice hosting, or some other sort of
dedicated hosting. These may provide greater resources for your web
server, but may not have some consumer features such as a web based
CPANEL interface.</para>
</listitem>
</orderedlist>
<sidebar>
<title>Detour - Understanding the *NIX Permissions</title>
<para>Unix/Linux use a set of permissions for the owner of the file/directory, called "User"; the group that the user is a member of ("Group"); and everyone else ("Other").</para>
<para>On a typical shared host, when you upload files to the server using command line (wget), CPanel, or FTP, the files associate your account with the provider as the owner and your group as the group. Apache doesn't run under your account, so the Apache user is considered "other". Therefore, any files modified or directories created by Drupal must be under the permission of "other". For security reasons, you don't want Apache to be able to do things you don't want (like modify code files) as that is a security issue. Usually, you only want the webserver (Apache) to have the ability to write to specific directories. In Drupal, it is the files directory where users upload files (images, etc.). All other folders should not have write permissions for the web server.</para>
<para>As a special case, when you first install Drupal, you want the webserver to temporarily be able to do two things to get Drupal installed you normally wouldn't allow:</para>
<itemizedlist>
<listitem>First, you want it to edit the settings.php with the information you provide around database user/password, etc</listitem>
<listitem>Second, you want it to create an empty files directory so users have a place to put their files. </listitem>
</itemizedlist>
<para>To do this on a Unix or Linux system, you simply need to do two things:</para>
<itemizedlist>
<listitem>Give "other" write permission to the settings.php you created.</listitem>
<listitem>Give "other" write permission to the "default" folder. By default, this is where Drupal will try to create the files folder. For a multisite install, these instructions are slightly different, but that is beyond the scope of this course.</listitem>
</itemizedlist>
<para>If you have command line access to your server (shell or ssh are other common names for this), then follow the instructions in the INSTALL.txt file in the root Drupal folder. If you don't have shell access (you are using CPANEL, FTP, or just prefer a GUI interface), then you'll have to figure out how to give "other" write access to the settings.php file and the sites/default folder. The result should be the same.</para>
</sidebar>
</section>
<section><!--Record Your Setup Information-->
<title>Record Your Setup Information</title>
<para>Since Drupal runs in lots of places you'll need to record information
specific for how your class will run. Most of this information will come from
your instructor.</para>
<variablelist>
<title>Class Setup Information</title>
<varlistentry>
<term>DRUPAL_ROOT_URL</term>
<listitem>
<para>
This is the URL you'll be using to get to your class drupal. If you are
running locally this could be http://localhost/drupal6sitebuilding or
perhaps http://localhost:8888/drupal6sitebuilding. If you are running this
on a server provided by the instructor they will provide this URL to you.
You'll know it is right as you should see a Welcome to Drupal Install
screen when you go to that URL in your browser.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DRUPAL_ROOT_PATH</term>
<listitem>
<para>
This is how you'll get to where your Drupal Installation files if you need
to add or modify files. If you are running this locally it could simply be
a local file path such as C:\wamp\htdocs\drupal. If you are running this
on a server provided by the instructor they will provide you with this
information and how to manage files as needed for the course.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>PHPMYADMIN_URL</term>
<listitem>
<para>
If you are running this locally this could be http://localhost/phpmyadmin.
If you are using an environment provided by the instructor they may have
already set up a database for you so you may not even need this.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MYSQL_USERNAME</term>
<listitem>
<para>
A MYSQL Username that has access to a blank MYSQL database to install
Drupal to. You'll need this during Drupal Web Based Install.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MYSQL_PASSWORD</term>
<listitem>
<para>
A password for the above Mysql user. You'll need this also during the
Drupal Web Based Install.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MYSQL_DATABASE_NAME</term>
<listitem>
<para>
The Mysql database name that you want to install Drupal too. You will
either create this during class or your instructor may provide you this
information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DRUPAL_ADMIN_NAME</term>
<listitem>
<para>
You will create this yourself during the course during Drupal installation.
It is the first user you create for your website during Drupal install.
You'll need this recorded somewhere.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DRUPAL_ADMIN_PASSWORD</term>
<listitem>
<para>
You will create this yourself during the course during Drupal installation
to go along with above admin user name.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section><!--Before Installing Drupal-->
<title>Before Installing Drupal</title>
<para>These are the high level steps you must complete prior to starting the web
based Drupal install. We are not providing detailed steps as this will vary
somewhat depending on where you are installing Drupal (local environment vs. a
web server set up for class, etc.)</para>
<orderedlist>
<listitem>
<para>Download Files for Class. Don't just download the standard Drupal
install files and the class files have additional files included for
class (contributed modules, images, etc.)</para>
</listitem>
<listitem>
<para>Create the configuration file (settings.php) by copying the
default.settings.php</para>
</listitem>
<listitem>
<para>Modify file permissions on the new settings.php file and on the
sites/default folder to allow for Drupal install</para>
</listitem>
<listitem>
<para>Create a blank MYSQL database.</para>
</listitem>
</orderedlist>
<para>Your instructor will guide you in these activities as per your class
setup.</para>
</section>
</chapter>
<chapter><!--Install Drupal for the First Time-->
<chapterinfo>
<title>Installing Drupal for the First Time (Web Based Installer)</title>
</chapterinfo>
<para>Assumptions: You have a blank MySQL database and have configured the drupal
installation files in preparation for a web based install. You have recorded the
needed information as per the previous section></para>
<section><!--Install Drupal -->
<title>Installing Drupal </title>
<task>
<title>Installing Drupal </title>
<tasksummary>We will install Drupal</tasksummary>
<procedure>
<step><para>Go to DRUPAL_ROOT_URL</para></step>
<step><para>Select Install in English.</para></step>
<step><para>Setup the database.</para>
<para>database name = <userinput>MYSQL_DATABASE_NAME</userinput></para>
<para>database username = <userinput>MYSQL_USERNAME</userinput></para>
<para>database password = <userinput>MYSQL_PASSWORD</userinput></para></step>
<step><para>Click Advanced, but don't change anything.</para>
<sidebar>
<title>Advanced Options</title>
<para>Before proceeding, please note the Advanced options. For example, the
database prefix option allows you to run more than one Drupal
installation from a single mysql database, using a table
prefix that you specify. Use a separate prefix for each install.
This isn't a great idea, but could, for example, allow you to get around
limitations of a shared hosting environment.</para>
</sidebar>
</step>
<step><para>Click next.</para></step>
<step><para>Configure the site:</para>
<para>Site Name = Ournews</para>
<para>Site email = noreply@example.com </para>
<para>Administrator..Username = DRUPAL_ADMIN_NAME </para>
<para>Administrator..email address= webmaster@example.com </para>
<para>Administrator..password = DRUPAL_ADMIN_PASSWORD </para>
<para>Select the time zone</para>
<para>Make sure clean urls is on.</para>
</step>
<step><para>Click next</para></step>
<step><para>Click You may now visit your new site</para></step>
</procedure>
</task>
</section>
</chapter>
<chapter><!--Creating Content-->
<chapterinfo>
<title>Creating Content</title>
</chapterinfo>
<abstract>
<para>Now we have an empty site. Next is to learn the basics of adding
content. We'll learn how to create the most basic content type, where it is
displayed by default, and some basic content creation options.</para>
</abstract>
<section><!--Create First Content-->
<title>Creating Basic Content</title>
<task>
<title>Creating an Article Node</title>
<tasksummary>Let's create our first story for our new "Drupal High" Web site.</tasksummary>
<procedure>
<step><para>Click the "Add new content" link in the gray shortcut bar. You'll find it just below the black
toolbar that spans the top of the page.</para></step>
<step><para>Select Article</para>
<note><para>Briefly discuss the two out of the box content types.</para></note></step>
<step><para>New Page Information</para>
<para>Title = <userinput>Drupal High Web Site Launched</userinput></para>
<para>Body = <userinput>Principal Dries has commissioned this exciting new Web site.
This Web site is based on Drupal - the powerful CMS with outstanding support for
building a community-based Web site. Check back often as this Web site will
take off fast!</userinput>
</para>
</step>
<step><para>Describe the basic options briefly</para>
<variablelist>
<varlistentry>
<term>- Input Format</term>
<listitem><para>Input formats are a common source of errors for new users. We will come back to this in a moment.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Revision Information</term>
<listitem><para>Retains revision information so you can roll back to old content. You probably don't
want this for all content types.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Comment Settings</term>
<listitem><para>Obvious?</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Authoring Information</term>
<listitem><para>Leave blank for anonymous. As the administrator, you may want the ability to post as someone
else. You probabl don't want this enabled for users.</para></listitem>
</varlistentry>
<varlistentry>
<term>Publishing Options</term>
<listitem><para>Published means accessible to users. Promoted to home page means it will appear on the default
home page. Sticky at top of lists means that it will come to the top of the home
page or similar views of content (above other "non-sticky" published nodes).
This will become obvious by example.</para></listitem>
</varlistentry>
</variablelist>
<note><para>Remember: What a user sees is based on their permissions. Since we are logged in as "user 1", or the root user, we see all options when creating content. Permissions, which are covered later, allow us to control this.</para></note>
</step>
<step><para>Expand the publishing options and note that stories default to published
and promoted.</para>
</step>
<step><para>Don't change any other options for now. </para>
</step>
<step><para>Click Preview.</para></step>
<step><para>Note the preview. There are two ways to show content: the shorter <emphasis>trim version</emphasis> and the <emphasis>full version</emphasis>.</para>
</step>
<step>
<para>Enter a sample sentence and then copy and paste it to have about 20 lines of text.</para>
</step>
<step><para>Cilck Preview again, and note the differences between the "trim" version and the full version.</para>
<note><para>By default, Drupal trims the story to display the first 600 characters. You can change the number of characters.</para></note>
</step>
<step><para>What is the "Edit Summary" link all about?</para>
<para>Click the "Edit summary" link next to "Body"</para>
<note>Note the two boxes that appear.</note>
<para>Enter some text into the new summary text box. Be sure to use different text then
what is already in the body field.</para>
</step>
<step><para>Click "Preview" once again. </para>
<note><para>Note how the full view doesn't include the teaser at all.</para></note>
</step>
<step><para>Go to the home page to view the story, then click on the story title (or the "read more" link) to see the full story - confirm it displays as you expected - the full version includes the teaser and the extra body content.</para></step>
</procedure>
</task>
</section>
<section><!--Tour of Drupal Admin "out of the box"-->
<title>Tour of Drupal Admin "out of the box"</title>
<task>
<title>A quick look at some admin settings.</title>
<tasksummary>You need to be familiar with the range of administrative options Drupal provides out of the box. We'll take a quick look and change a few settings here.</tasksummary>
<procedure>
<step>
<para>Before we start, lets discuss the toolbar and the shortcut bar. The toolbar (the
black bar across the top) is your main administrative navigation. The grey shortcut
bar allows you to add any links that you visit often whenever you want. These can be
setup globally or on a per-user basis. Let's take a quick look. Click the Structure
link in the toolbar and then click the "Snapshots" link. Now, click the "+" directly
next to the "Snapshots" title. Now you have a new shortcut!</para>
</step>
<step><para>A quick tour of the configuration options with no additional modules enabled yet.</para>
<para>
<variablelist>
<varlistentry>
<term>Clean URLs</term>
<listitem>
<para>
Consider two URLs. http://mysite.com/?q=whatever vs
http://mysite.com/whatever. The previous is called a URL with a
"querystring". Since we are using a database to store our data the paths do
not represent real paths on the web server hard drive (i.e. there is not
file called "whatever" to be found). So the querystring represents
instructions on what we want to retrieve and display. Most site owners want
paths that make sense to users. With clean urls turned on the querystring
is hidden to the user. Support for this feature is built into the Apache
webserver (and others).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>File System & Private Filessytem</term>
<listitem>
<para> Shows where on the web server that Drupal create the files folder by default.
This folder must be writable by the server process. By default this folder is
placed below the default folder at "sites/default/files". As of D7 you can
have two folders; one for public files and one for private files. If you are
using private files you may want to move this folder to someplace above your
apache document root. </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Input Formats</term>
<listitem>
<para>We'll talk about this more in the context of editing content. In short it allows
you to filter and control what users enter to avoid bad information in your
site. </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Performance</term>
<listitem>
<para>
How does Drupal standard caching work? Good news for sites with a lot of
anonymous users. Are there other options? What do the other options do
(and when might you turn them off)?
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Site Maintenance</term>
<listitem>
<para>
Putting your site in maintenance mode (when should you do that).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Site Information</term>
<listitem>
<para>
Basic information about your site (may be used by themes).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</step>
<step>
<para>Modify the Site Information as follows:</para>
<para>Slogan = <userinput>Our slogan at Drupal High School is to development the next
generation of leaders Drupal Leaders!</userinput></para>
<note><para>Note that here you can change the default home page and the default 403/404 pages to any path
- a specific page, or view or panels if you're using those modules.</para></note>
</step>
<step>
<para>Go to Post Settings.</para>
<note><para>Note the number of posts on the home page.</para></note>
</step>
<step>
<para>Set it to 5 only.</para>
</step>
<step><para>The structure options contains the building blocks for your content.</para>
<para>What is a block?</para>
<para>What is a content type?</para>
<para>What is a menu?</para>
<para>What is a taxonomy?</para>
</step>
<step>
<para>The modules options allow you to enable and disable specific functionaility on
your site.</para>
<para>Enable the "module filter" module by clicking hte checkbox on the left and then
clicking "Save configuration". After the page re-loads notice that we have some new
functionality. </para>
</step>
<step>
<para>The appearence options allow you to select and configure what theme(s) your site
should use.</para>
<note>
<para>Explain the Administrative theme. Now is probably a good time to talk about the
overlay as well.</para>
</note>
</step>
<step>
<para>Go through people options</para>
<para>Permissions (we can create roles, new modules and content types will show additional permission options so always go back here after adding modules or new content types)</para>
<para>What are roles?</para>
<para>Users (compare to ability to manage content here ability to manage/edit users)</para>
</step>
</procedure>
</task>
</section>
<section><!--Editing and publishing options-->
<title>Editing and publishing options</title>
<task><title>Adding another story and understanding publishing Options</title>
<tasksummary>To better understand the basic publishing options.
We'll create another "story" and demote the first page we created above so it is published, but not on the home page.</tasksummary>
<procedure>
<step><para>Let's first make a note of the link to the first article.</para>
<para>Click on the first article title. Jot down the URL somewhere.</para>
</step>
<step><para>Now, let's create a second article.</para>
<para>Click Create Content, then click Article.</para>
</step>
<step><para>Enter the following:</para>
<para>Title = <userinput>Welcome Returning Students!</userinput></para>
<para>Body = <userinput><markup><p><strong>Principal Dries</strong> here!</p>
<p>Welcome to a new school year at Drupal U! We hope you are looking forward to the new year just as we are. Check back soon for more news and information. We'll have information for students, teachers, and parents.</p>
<p> - <em>D.B</em></p></markup></userinput></para>
</step>
<step><para>Click Save, then go to the site home page.</para>
<note><para>Where does the story end up?</para></note>
</step>
</procedure>
</task>
<task>
<title>Making the first story "sticky"</title>
<procedure>
<step><para>Click the first story we created ("Drupal High Web site
Launched")</para>
<para>Let's say we want that story to stay at the top for awhile. This is known as "sticky" in Drupal.</para>
</step>
<step><para>Click "Edit".</para></step>
<step><para>Click the publishing options tab and select "Sticky at top of lists".</para></step>
<step><para>Click Save.</para></step>
<step><para>Go to the home page</para>
<note><para>Note this story comes to the top and has slightly different (theme-dependent) formatting.</para></note>
</step>
</procedure>
</task>
<task>
<title>Removing the story from the home page</title>
<procedure>
<note>
<para>
After awhile, we may not need that story so prominently highlighted, so let's take it off the home page.
</para>
</note>
<note>
<para>This time, instead of clicking into the article in order to edit it, lets use the
contextual links. Notice when you rollover the article teaser on the homepage a small
gear appears at the top right.</para>
</note>
<step><para>Click the contextual link gear and choose "edit."</para></step>
<step><para>Click the publishing options, deselect "Sticky" and "Promoted to home page".</para></step>
<step><para>Click Save, and notice we are right back on the home page.</para>
<note><para>Note it is no longer on the home page, but where did it go?</para></note></step>
<step>
<para>
Enter the URL you recorded earlier for that story (for example "localhost/drupalintro/node/1").
</para>
<note><para>Note that the story is still available</para></note>
</step>
<step><para>Return to the home page</para>
<para>As you can see, this story is still published, but where would a user find it from the home page? Right now, the only way is thorugh a link. It is still accessible because it is published, but we need to link to it or something so visitors can get to it.</para>
<para>What if it were unpublished? What if we don't have the link handy? How do we as content editors find it later? We'll discuss that later...</para>
</step>
</procedure>
</task>
</section>
<section><!--Static Pages, the Basic Page Content Type-->
<title>Static pages, the Basic Page content type</title>
<task><title>Creating an "About Us" page.</title>
<note><para>This will be a placeholder for the typical "about us" page most
websites have.</para></note>
<procedure>
<step><para>Click Add Content, Basic page</para></step>
<step><para>Create the page as follows:</para>
<para>Title = <userinput>About Us</userinput></para>
<para>Body = <userinput>Placeholder for an about us page.</userinput></para>
</step>
<step><para>Click the "Publishing Options" tab</para>
<note><para>Note the difference from the story type - it is not promoted to home
page by default. We'll promote it for now just so we can see it, but we
probably wouldn't want our about us page to be in our "news" section.</para></note>
</step>
<step><para>Change publishing options to "Promoted to home page" (and make sure it is "published" too!).</para></step>
<step><para>Save the page.</para></step>
<step><para>Go to the home page.</para>
<note><para>Note the differences vs. the story type we used before. There is no
user/date/time displayed. This makes sense for static content that will always
be there, but there is a way to control this behavior.</para></note>
</step>
</procedure>
</task>
<para>So what's the deal with stories having the date and username posted
displayed, and "page" content types not having it? Those are called Post
Settings. You can control them, but it is in an odd place...</para>
</section>
<section><!--Post Settings-->
<title>Content Type Settings</title>
<task>
<procedure>
<step>
<para>Don't change anything on this form right now, let's just explore.</para><para>Click Structure, Content Types, then click the "Edit" link next to the Basic Page content
type.</para>
<para>There you will see a set of tabs at the bottom of the screen. Click the "Dispay
settings" tab. Notice that you can choose to display the author and date information.
Do nt change anything here. </para>
</step>
<step>
<para>Click the "Submission form settings" tab. Here you can change the title of the
"title field" as well as control the preview button. </para>
</step>
<step>
<para>Click the "Publishing options" tab. Here you can set the default options for the
checkboxes in the "Publishing options" on the node edit form.</para>
</step>
<step>
<para>Click the "Comment settings" tab. Here you can control comments.</para>
</step>
<step>
<para>Click the "Menu settings" tab. Here you can control menus.</para>
</step>
</procedure>
</task>
</section>
<section><!--Our first menu! A menu preview.-->
<title>Our First Menu! A Menu Preview</title>
<task>
<tasksummary>Hmm, that "About Us" page really doesn't belong in the "river of
news" on our home page. How would a user typically access an "About Us" page?
Of course, through a menu. Let's see one way to do that.</tasksummary>
<procedure>
<step><para>Click the contextual links "gear" icon and choose "edit."</para></step>
<step><para>Click the "Menu Settings" tab and check the "Provide a menu link" box.</para></step>
<step><para>Put "About Us" as the menu title link</para>
<para>Note, but don't change, the default menu it will go on. Also, don't
worry about the "weight" option for now.</para>
</step>
<step><para>Go down to the "Publishing Options", and turn off "Promoted to Front Page"</para></step>
<step>
<para>Save the page. </para>
<note>
<para>So it isn't in the river of news now. Can you find the menu choice where it is
now accessible? This is the default "Primary Menu" and it's positioning is based on
where the default Drupal "Bartik" theme puts the primary menu. As we'll see later,
other themes may display menus very differently. More on menus later!</para>
</note></step>
</procedure>
</task>
<note>
<para>Catchup Point! To catch up to this point apply Demo snapshot
"03-Completed_Content_Creation" (Administration, Site Building, Demonstration Site, Reset
Site)</para>
</note>
</section>
</chapter>
<chapter><!--Sources of Content - Blocks and Modules-->
<chapterinfo>
<title>Sources of Content - Blocks and Modules</title>
<abstract>
<para>So what is content really? Where does information for our pages come from.</para>
</abstract>
</chapterinfo>
<para> We've seen how to create article and page content types and where they are displayed.
But is that the only thing that is content? In the broadest sense content is anything visible
to the user.</para>
<para>Content can be:</para>
<orderedlist>
<listitem>
<para>Menus</para>
</listitem>
<listitem>
<para>Posted Content (stories, pages, other types we'll make)</para>
</listitem>
<listitem>
<para>User comments on stories (when enabled)</para>
</listitem>
<listitem>
<para>"Theme content" and such like site title, footer, site slogan, others</para>
</listitem>
<listitem>
<para>"Blocks" provided by modules (or created manually by you). An example
is the user login block displayed when you go to a site without logging in.
If you install new modules they may add additional blocks that you can use!</para>
</listitem>
<listitem>
<para>Contributed modules like Views may even allow you to make your own
advanced block content without programming.</para>
</listitem>
</orderedlist>
<para>Let's take a look at how blocks may be provided by modules.</para>
<section><!--Place blocks already available from core modules-->
<title>Place blocks already available from core modules</title>
<task>
<procedure>
<step><para>Go to Structure, Blocks</para>
<note><para>Note the items already there in the default positions as placed by
Drupal install. These blocks are all supplied by core modules enabled by
default. Note there are a few that aren't placed anywhere yet. Let's place
a couple.</para></note>
</step>
<step><para>Place "Who's Online", then place "Who's New" in sidebar first.</para></step>
<step><para>If necessary, select "None" for the "Demo Site Reset" block.</para></step>
<step><para>Try dragging them around using the drag handles!</para></step>
<step><para>Save.</para></step>
<step><para>Return to the home page</para>
<note><para>Note the new blocks displayed on the home page.</para></note>
</step>
</procedure>
</task>
</section>
<section><!--Enable another core module to get new page content-->
<title>Enable another core module to get new page content</title>
<task>
<title>Enable the new modules</title>
<procedure>
<step><para>Go to Modules in the Toolbar</para></step>
<step><para>Tpye "poll" in the filter list field</para></step>
<step><para>Enable the Poll Module</para></step>
<step><para>Click Save Configuration</para></step>
</procedure>
</task>
<task>
<title>Make a Poll</title>
<procedure>
<step><para>Choose "Add Content" from the gray shortcuts bar.</para>
<para>Hey look, a new content type (poll) is available ;) Not all modules create
new content types, but some do.</para></step>
<step><para>Create a new poll as follows:</para>
<para>Title = What is your favorite class this year?</para>
<para>Choice 1 = <userinput>Drupal Intro</userinput></para>
<para>Choice 2 = <userinput>Theming 101</userinput></para>
<para>Choice 3 = <userinput>Ninja Development</userinput></para>
</step>
<step><para>Save the Poll</para>
<note><para>Don't vote on it yet!</para></note>
</step>
<step><para>Go to the home page</para>
<para>Note the poll appears on our home page in the "river of
news".</para>
<para>But what if we want the poll to appear on the side somewhere?</para>
</step>
<step><para>Go to Structure, Blocks</para>
<note><para>Note the new block available for "Most Redcent Poll" (another gift
from the poll module).</para>
</note>
</step>
<step><para>Add the "Most Recent Poll" block to the second sidebar</para></step>
<step><para>Save Configuration</para></step>
<step><para>Return to the home page</para>
<para>Hey there's our poll on the right side! Don't vote on it yet ;)</para>
<para>But now we don't need it in the river of news anymore. Do you remember
how to remove it from there, but still leave it published?</para>
</step>
<step><para>Edit the "What is your favorite class this year poll?"</para></step>
<step><para>Click the publishing options tab and deselect the "Published to front page" option.</para></step>
<step><para>Save, then return to the home page.</para>
<note><para>Note that the Poll is no longer in the "river of news", but since
we have placed the most recent poll block it is still displayed in the side
bar - just what we wanted!</para></note>
</step>
</procedure>
</task>
<note>
<para>Catchup Point! To catch up to this point apply Demo snapshot
"04-Completed_Sources_of_Content"</para>
</note>
</section>
</chapter>
<chapter><!--Roles, Permissions, and Visibility-->
<chapterinfo>
<title>Roles, Permissions, and Visibility</title>
<abstract>
<para>Next we'll learn how users are categorized into "roles", how Drupal handles
permissions, and how we can affect visibility of page elements by role as well.</para>
</abstract>
</chapterinfo>
<section><!--Roles and Permission-->
<title>Roles and Permissions</title>
<section>
<title>An Anonymous User</title>
<task>
<procedure>
<step><para>Log out.</para>
<para>When logged out we are treated by Drupal as the "anonymous" user. Note
that we can't vote on the poll now. This is the default permission for
anonymous users as set by the poll module. However, the poll module does
support anonymous user voting (it uses ip address to avoid dupes) if that is
what you want. So how do we do that? </para></step>
<step><para>Log back in as "demo" (pw: demo11)</para></step>
<step><para>Go to the home page and vote on the poll</para>
<note><para>Note how it displays the results after you vote. Now on to the roles and permissions.</para></note></step>
</procedure>
</task>
</section>
<section><!--Administering Permissions and User/1-->
<title>Administering Permissions and User/1</title>
<task>
<procedure>
<step><para>Go to People, Permissions</para>
<note><para>Note that anonymnous, authenticated & administrator user roles are there automatically and
can't be deleted.</para></note>
<para>What other roles might a typical site need/want? Editor? Member? Intern? Legal?
etc.</para>
</step>
<step><para>Look for permissions for the Poll Module</para>
<note><para>Note: It is common for modules to add permissions so this is a good
place to check after installing modules. It is also a very common thing to
look for if a module's features don't work as you expect.</para></note>
<note><para>While we're here, also note the Node section of permissions. Each
content type gets its own set of add/edit/delete permissions which is important
to remember when you start creating additional content types (which we'll learn
to do later). A good reference on this topic can be found at
<ulink url="http://gotDrupal.com/videos/understanding-Drupal-permissions">http://gotDrupal.com/videos/understanding-Drupal-permissions</ulink></para></note>
<para>Note that neither anonymous nor authenticated user roles have
permissions to vote on polls. So even if new users register they won't be able
to vote on the poll at the moment. Hmm, but didn't we just vote on a poll? There
is something not obvious from this screen that requires explanation. The reason we are able to vote here is because the very first user you create during installation (known as user/1, and in Drupal 7 as the "site maintenance account") has special permissions. User/1 automatically has all available permissions by definition. You'll note that as a result user/1 doesn't even appear on this screen.</para>
<note><para>Another important note here - User/1 is also the only user who can
run update.php which is needed when upgrading modules or Drupal . In Drupal
7 this user is called the Site Maintenance user to further clarify this special
role.</para></note>
</step>
<step><para>Select the permission to allow authenticated users to "vote on
polls", then click "Save Permissions".</para></step>
<step><para>Return to the home page by closing the overlay.</para></step>
</procedure>
</task>
</section>
</section>
<section><!--Visibility by Role (and path...)-->
<title>Visibility by Role (and path...)</title>
<task>
<procedure>
<step><para>Log out.</para>
<note><para>Note that even anonymous users can currently see the "current poll"
block on the home page.</para></note></step>
<step><para>Click on the "Welcome Returning Students" story title.</para>
<note><para>Note that even when viewing a full story (node) page we can see all of the blocks on the right.</para></note>
<para>What if we want the "Who's online?", "Who's logged in?", and Poll block to
only show up on the home page? We'll see that this is controlled by block
visibility.</para></step>
<step><para>Log back in as admin</para></step>
<step><para>Go to Structure, Blocks</para></step>
<step><para>Find the "Most Recent Poll" block and click
"Configure"</para><para>Take the time to review the block settings</para><para>Block Title, User specific visibility settings, Role specific visibility settings, Page specific visibility settings</para></step>
<step><para>Select "authenticated users" & "administrator" for Role specific visibility.</para></step>
<step><para>For page specific visibility settings, select "Show only on the
listed pages", then enter "<front>" in the box (as per the comment below
the box!).</para></step>
<step><para>Repeat the previous two steps for the "Who's Online?", and "Who's
New?" blocks.</para></step>
<step><para>Go to the home page.</para>
<note><para>Note all three display</para></note></step>
<step><para>Click on the "Welcome Returning Students" story title</para>
<note><para>Note that none of the blocks display as we aren't on the home
page.</para></note></step>
<step><para>Return to the home page</para></step>
<step><para>Log out</para>
<note><para>Note that none display as we aren't authenticated
users.</para></note></step>
<step><para>Log in</para><para>Bonus question: Who can tell what is happening in
the left column of our Web site? What causes it to show a login page when we
logout and a "navigation" menu in the same spot when we log in? If you can
answer this then I know you understand the basics of blocks and
visibility!</para></step>
</procedure>
</task>
<sidebar><!--What to look for after enabling new modules-->
<title>What to look for after enabling new modules</title>
<para>We've seen that modules that we enable may add a number of features to our
site. These are good pages to visit after enabling or adding a new module to
check for new functionality or settings (of course you should also read any
"readme" files or documentation available with a module).</para>
<variablelist>
<varlistentry>
<term>People, Permissions</term>
<listitem>
<para>
Check here to see if there are new, module specific, permissions that
need to be set.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Content or Structure, Content Types</term>
<listitem>
<para>
See if the new module added any new content types.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Modules</term>
<listitem>
<para> See what other settings screens this module may have defined. Next to each
enabled module you will see a configuration link. </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Structure, Menus</term>
<listitem>
<para>
We haven't looked at this screen yet, but this is a good place to check
if the module has created new menus.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>INSTALL.txt or README.txt</term>
<listitem>
<para>
If this is a contrib module (we'll be looking at some shortly), then
look in the folder for the module and look for INSTALL.txt or
README.txt. You should review these even before enabling a new
module.
</para>
</listitem>
</varlistentry>
</variablelist>
</sidebar>
<note>
<para>Catchup Point! To catch up to this point apply Demo snapshot
"05_RolesPermissionsBlockVisibility" (Administration, Site Building, Demonstration Site, Reset
Site)</para>
</note>
</section>
</chapter>
<chapter><!--Menus!-->
<chapterinfo>
<title>Menus!</title>
<abstract>
<para>So we did a little bit with menus ealier in the class (note the "About Us"
menu). We'll now talk more about menus and how they are created/managed.</para>
</abstract>
</chapterinfo>
<section><!--Add and edit menus while creating content-->
<title>Add and edit menus while creating content</title>
<para>We've already seen that one way to add something to the menu is to do so while
creating or editing content (nodes).</para>
<task>
<procedure>
<step><para>Click "About Us"</para></step>
<step><para>Edit It</para></step>
<step><para>Click the Menu Settings tab and note how we've currently added a Menu Link Title and put it on
the primary menu.</para><para>Let's add
something else to the primary menu. (We'll create a page with links to offsite
"pages of interest".</para></step>
<step><para>Click Add Content, then Basic Page</para></step>
<step><para>Create as follows:</para>
<para>Title = <userinput>Offsite Resources</userinput></para>
<para>Body = <userinput><markup><ul><li><a href="www.Drupal .org">Drupal Home Page</a></li><li><a href="http://groups.Drupal .org">Drupal Groups</a></li></ul></markup></userinput></para></step>
<step><para>Now, click "Menu Settings," check "Provide a menu link" and set as follows</para>
<para>Menu Link Title = <userinput>Resources</userinput></para>
<para>Parent Item = pick "Main Menu"</para>
<para>Weight = <userinput>0</userinput></para>
</step>
<step><para>Under "Publishing Options", ensure it is published, but not promoted
to home page.</para></step>
<step>
<para>Save</para>
</step>
<step><para>Go to home page</para>
<note><para>Note the addition to the primary menu. However, we'd really like to
have "About Us" always be the last menu.</para></note>
</step>
</procedure>
</task>
<para>Understanding "weights" is our next step.</para>
<para>Currently the Primary menu is simply displaying items in alpha order.</para>
<task>
<procedure>
<step><para>Click "About Us"</para></step>
<step><para>Edit</para></step>
<step><para>Expand "Menu Settings" (if necessary) and note "Weight" (zero)</para></step>
<step><para>Do the same thing for the "Resources" menu item (i.e. edit it and look
at the Weight value)</para></step>
<para>Menus are one example where weight is used. You'll see others as you get more
experienced. Let's try something.</para>
<step><para>Click "About Us"</para></step>
<step><para>Edit</para></step>
<step><para>Change the weight to fifty (50)</para></step>
<step><para>Save</para>
<para>So what happened to the menu at the top?</para>
<para>Because it is "heavier", it sinks to the bottom.</para>
<para>This concepts of weights seems rather user unfriendly. Is there a better
way? With the advent of javascript in Drupal yes.</para></step>
</procedure>
</task>
</section>
<section><!--Managing Menus-->
<title>Managing Menus</title>
<task>
<procedure>
<step><para>Go to Structure, Menus</para>
<para>Note the default menus here. Brief descriptions:</para>
<variablelist>
<varlistentry>
<term>Main Menu</term>
<listitem>
<para>This is most commonly used as your site's main menu. It's display position
is controlled by the theme (most commonly). When you add a content item to the
menu this is typically the default for where it will go. </para>
</listitem>