drupal_overview.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. Brief Drupal Overview
  2. =====================
  3. .. note::
  4. Some of the images used on this page refer to Tripal v2. However, this Drupal overview applies equally well to both versions.
  5. User Account Page
  6. -----------------
  7. All users have an account page. When you first install Drupal, you are logged in as the administrator. The account page is simple for now. Click the **My account** link on the left sidebar. You'll see a brief history for the user and an **Edit** tab. Users can edit their own information using the edit interface:
  8. .. image:: drupal_overview.account_edit.png
  9. Creating Content
  10. ----------------
  11. Creation of content in Drupal is very easy. Click the **Add content** link on the top administrative menu.
  12. .. image:: drupal_overview.create_content1.png
  13. You'll see two content types that come default with Drupal: Article and Basic Page. Here is where a user can add simple new pages to the website without knowledge of HTML or CSS. Click the **Basic Page** content type to see the interface for creating a new page:
  14. .. image:: drupal_overview.create_content2.png
  15. You'll notice at the top a **Title** field and a **Body** text box. All pages require a title and typically have some sort of content entered in the body. Additionally, there are other options that allow someone to enter HTML if they would like, save revisions of a page to preserve a history and to set authoring and publishing information.
  16. For practice, try to create two new pages. A **Home** page and an **About** page for our site. First, create the home page and second create the about page. Add whatever text you like for the body.
  17. In the screenshots above, you may have noticed the link **Add Tripal Content**. Tripal content is different from the typical Drupal content types: **Basic Page** or **Article**. Instead the content that Tripal provides is the biological and ancillary data that your site will provide to users. Later this tutorial will describe how to add new biological data.
  18. Finding Content
  19. ---------------
  20. To find any content that has been created on the site, click the **Find Content** link on the administrative menu at the top. The page shows all content available on the site. You will see the **About** and **Home** pages you created previously:
  21. .. image:: drupal_overview.find_content.png
  22. You'll also notice a set of drop down boxes for filtering the content. For sites with many different content types and pages this helps to find content. You can use this list to click to view each page or to edit.
  23. Later in this guide, instructions will be provided for finding Tripal Content. Tripal content is different from the typical Drupal content types: **Basic Page** or **Article**. Instead the content that Tripal provides is the biological and ancillary data that your site will provide to users. It is also accessible via a link named **Find Tripal Content** found on the same menu bar as **Find Content**
  24. Site Administration
  25. -------------------
  26. Modules
  27. ^^^^^^^
  28. Click the **Modules** link on administrative menu at the top of the page:
  29. .. image:: drupal_overview.modules.png
  30. Here is where you see the various modules that make up Drupal. Take a minute to scroll through the list and read some of the descriptions. The modules you see here are core modules that come with Drupal. Those that are checked come pre-enabled. Those that are not checked we will need to install them if we want to use them. To enable or "turn on" a module, check the box next to the desired module, then scroll to the bottom and click 'Save configuration'. Your site will now have the functionality provided by that module. Alternatively, you can search for modules that may be useful to your intended site design at the Drupal module repository, https://drupal.org/project/project_module, and install them by clicking the **Install New Module** link. Finally, a 3rd method to install modules is by use of the drush tool. We will use drush for this tutorial.
  31. Themes
  32. ^^^^^^
  33. Next, click the **Appearance** link on the administrative menu at the top of the page:
  34. .. image:: drupal_overview.appearance1.png
  35. Here, you'll see a list of themes that come with Drupal by default. Here you will see the **default theme** is called **Bartik**. This theme controls the appearance of all content on the site. You can easily change the way the site looks by changing the default theme to another theme. For this tutorial, we would like to use the **Garland** theme. If you scroll down you'll see that one theme named Garland. click the link in the Garland theme section titled **Enable and set default**. The current look of the site is using the Garland theme.
  36. .. image:: drupal_overview.appearance2.png
  37. Now, click the house icon in the top left. Our home page now uses the Garland theme:
  38. .. image:: drupal_overview.appearance3.png
  39. Blocks
  40. ^^^^^^
  41. Blocks in Drupal are used to provide additional content to any page that already exists. Examples of blocks might be a short overview of recent news items, Twitter feeds, links, recently added content, etc. The blocks interface can be found by navigating to **Structure → Blocks** using the top administrative menu.
  42. On this page you'll see a list of available blocks and where they are located within the site.
  43. .. image:: drupal_overview.blocks1.png
  44. Here you can see that the **Search form**, **Navigation**, and **User Login** blocks are all on the left sidebar of Garland theme. There are also a list of other regions available that do not have any blocks and there are many blocks which are Disabled but could be added to a region on the page. For this tutorial, we would like for blocks to appear on the right sidebar rather than the left sidebar. Therefore, change the **Search form**, **Navigation**, and **User Login** to all use the right sidebar by changing the drop down box next to each one. When done, click the **Save Blocks** button at the bottom. Now when we view our home page the navigation links, search form and user login box (not shown while logged in) all appear on the right side:
  45. .. image:: drupal_overview.blocks2.png
  46. Menus
  47. ^^^^^
  48. For this tutorial, we want to add new links in the **Main Menu** to our new Home and About pages we created earlier. In the Garland theme, the main menu appears in the top right corner and currently only has the link 'Home'. We want to change this link to direct to our new home page. But first, we need to find the path for our home page. The path for a page can be found in the address bar for the page. In Drupal pages of content are generally referred to as **nodes**. We can find the new home and about pages using the **Find content** link in the top administrative menu. If we click the link for our home page you'll see the address is http://localhost/node/1. Our about page is http://localhost/node/2 (i.e the first and second pages we created).
  49. Drupal provides an interface for working with menus, including adding new menu items to an existing menu or for creating new menus. You can find the interface for working with menus by navigating to **Structure → Menus** via the administrative top menu:
  50. .. image:: drupal_overview.menus1.png
  51. Click the link list links in the operations section for the **Main Menu**. Here we see that the **Home** link already exists:
  52. .. image:: drupal_overview.menus2.png
  53. Click edit to change the location of the Home menu item. In the form that appears, we need to set the path for our new home page. The path for each of these nodes is **node/1** and **node/2**. Fill out the form fields with these values
  54. .. csv-table::
  55. :header: "Form element", "Value"
  56. "Menu Link Title", "Home"
  57. "Path", "node/1"
  58. "Description", "Tripal 2.0 Demo Home Page"
  59. "Enabled", "checked"
  60. "Show as Expanded", "no check"
  61. "Parent item", "<Main menu>"
  62. "Weight", "0"
  63. The resulting page appears as follows:
  64. .. image:: drupal_overview.menus3.png
  65. The settings above will give the menu link a title of **Home** and put it on the Main menu menu. If we then click the **Save** button at the bottom our **Home** menu item now redirects us to our new home page. Now, we also want to add a new menu item for the **About** page. Return to the **Main menu** configuration page and add a new link with the following values:
  66. .. csv-table::
  67. :header: "Form element", "Value"
  68. "Menu Link Title", "About"
  69. "Path", "node/2"
  70. "Description", "About this site"
  71. "Enabled", "checked"
  72. "Show as Expanded", "no check"
  73. "Parent item", "<Main menu>"
  74. "Weight", "0"
  75. Click **Save** and a new menu item should appear. You can then change the order of the menu items by dragging and dropping the link using the cross-hairs next to each menu item.
  76. URL Path
  77. ^^^^^^^^
  78. As mentioned previously, the URL paths for our pages have node/1 and node/2 in the address. This is not very intuitive for site visitors.
  79. To set a path, click on our new **About** page in the new menu link at the top and click the **Edit** tab (you may have to close the overlay to see the menu item). Scroll to the bottom of the edit page and you'll see a section titled **URL path setting**. click to open this section. Since this is our about page, we simply want the URL to be http://localhost/about. To do this, just add the word "about" in the text box and click the **Save** button. You will now notice that the URL for this page is no longer http://localhost/node/2 but now http://localhost/about. Although, both links will still get you to our About page.
  80. .. image:: drupal_overview.create_page.png
  81. Now, use the instructions described above to set a path of 'home' for our home page.
  82. Site Configuration
  83. ^^^^^^^^^^^^^^^^^^
  84. There are many options under the **Configuration** link of the administrative menu at the top. Here we will only look at one of these at the moment--the **Site Information** page. Here you will find the settings we made when installing the site. You can change the site name, add a slogan, mission and footer text to the. The section titled **Front Page** is where we can tell Drupal to use our new **Home** page we created as the first page visitors see when they view the site. We want this to be the same as the home page we created and added a link for in the **Main menu**. In this text box enter the text **node/1**. Notice there is no preceding forward slash. Alternatively we could have used the URL path we added in the previous step. Let's add a slogan: **Resources for Community Genomics**.
  85. .. image:: drupal_overview.settings.png
  86. Now, click the **Save configuration** button at the bottom. You'll now see the slogan now at the top of the page. Also, if you click the site name or the home icon at the top left we are now redirected to the new home page.
  87. User Accounts
  88. -------------
  89. For this tutorial, we will not discuss in depth the user management infrastructure except to point out:
  90. - User accounts can be created
  91. - Users are assigned to various roles
  92. - Permissions for those roles can be set to allow groups of users certain administrative rights or access to specific data.
  93. Explore the Drupal **User Management** menu to see how users can be created, added to roles with specific permissions.