Creating a Licensing Database UsingDrupal 7 – NASIG 2012By Amanda Yesilbas, Florida Center for Library AutomationContentsA...
Changing the Front Page .....................................................................................................
About the InstallationThe demonstration is using the pre-packaged Aquia version of Drupal found athttp://www.acquia.com/do...
4. Content Type- http://drupal.org/glossary#content-type    Every node belongs to a single “node type” or “content type”, ...
Getting StartedThe presentation will use a Drupal installation, with all relevant modules already installed, hosted by the...
Change the user’s status to active and choose what roles the user should have. Make sure to save.                         ...
A note on account creation - Take a moment to check securityAny new site will automatically be set up to allow users to cr...
Turning on ModulesDrupal gets it’s functionality through modules. Some modules are considered “core”, meaning they arepart...
Scroll down the list and find the modules that need to be activated. Note that many of these moduleshave multiple parts. E...
Now we will disable a module. Go to Modules from the administration menu at the top of the browser.Scroll down on the modu...
Choose create basic page.The red star indicates a required field. The top part of the form is the content of the webpage.T...
Saving your content will take you to the completed webpage. That is all it takes to make a basic page inDrupal.Finding Alr...
Editing Existing ContentIf you are logged on and an authorized user, you will see the edit tab on a piece of content. Clic...
License – file of titles, pdf, active dates, date sent to purchasing, date returned, acquisition terms,cancellation terms,...
The first screen sets the parameters of the content type. Here is where you name it and set up thebehavior. For the exampl...
Fields are the information that is part of our content type. Here we add things like the vendor contactname and email.    ...
C. There are many choices about what kind of information a field should store. Choose the type       that best suits your ...
Now, when the license field is clicked on in a vendor record a list of real time licenses appear.Field GroupsToo many fiel...
Once you have created the field group, drag your fields under the field group. They will be indented ifthey are properly p...
Adding Field Sets to the manage display will give you a result similar to this. The page is better looking,and the collaps...
PermissionsPermissions control who can see and do what in Drupal. Creation of content and viewing content arecontrolled by...
The first step is to make a new role of license viewer. From the permissions page click the roles link justunder the permi...
Here we see the roles defined for the site. In this example we only want the license viewer and theadministrator to be abl...
Permissions Based on TaxonomyAnother way to control access to content is through taxonomy terms by using the Taxonomy Acce...
Next add terms. In this case, terms will be the names of schools. Click the add terms link next to thevocabulary name. Typ...
5. On the next screen choose the vocabulary Schools.    6. Save the field.Now add a school to the statistic pages you made...
Assigning Taxonomy Permissions to a RoleTo assign the taxonomy permissions the new role click on Configuration in the Admi...
Under the heading New, select the term, in this case the school, that the permission will be for. Under    the column View...
Repeat this procedure for the authenticated roles.To test:    1.     Create a new user.    2.     Assign the new user the ...
To add a new view click +Add new view from the top of the page.    Most of our work for this view will be done on the Add ...
The second part of the page defines a page that displays the view.ABCD    A. Is inherited from the top but can be changed....
This takes you to the newly created view.To find the url of the page again, go back to the view page. Structure->views. Th...
Make a new view. Navigate Structure->Views->+Add new viewThe first part of the form is filled out in a very similar way to...
This page shows the advance settings for a view. When you come back to an already created view this isalso the page you wi...
A preview of your changes can be seen at the bottom of the screen. It should now look similar to this.Next add the usage s...
Rewriting Field OutputThe file name is very large and cumbersome. The output can be written to just display the word file....
Next open up the rewrite results collapsed area. Once opened, open the replacement pattern collapsedarea.The replacement p...
The preview should look something like this.Adding exposed filtersThis list could quickly become large and difficult to ma...
On the next screen, check the box expose filter. A new set of options will open up. Take the machinefield name out of the ...
REMEMBER TO SAVE YOUR VIEW! The save is on the top of the screen instead of the usual bottom.Updating is not saving.Now ta...
Adding a Block or Other Iteration of a ViewIf you want to add a block of a view ofrmake another page of the view with slig...
We only need a slight variation on the usage statistic view previously made. We need to get rid of theexposed filter and a...
Now the most important part, add the contextual filter. Contextual filters allows a single view to displayunique informati...
Override the title and breadcrumbs so the vendor is accurately displayed on the view page. Check theboxes next to both and...
This takes us to a view that looks remarkably similar to what we had before. The power lies in changingthe url.To change t...
Add the vendor number to the end of the URL. This will change the entire view.This is how contextual filters work. Instead...
First step is to get the path of the view. Navigate to the views list to find it. Structure ->views. Find thepath next to ...
In the first section of the site information screen, the title can be changed. Change it to LicenseDatabase.The middle of ...
Click on appearance in the admin menu across the top of the screen. Click on the tab setting in the topright corner.By unc...
The front page looks better but the menu doesn’t make sense. We want to add a menu that navigatesto different pages. We al...
Making a MenuClick on structure in the top admin menu and click on menus. Here is a list of already premade menus.To add a...
ABCD    A. What is filled in here will be what displays in the menu.    B. In this example I am linking to the vendor view...
Enabling the Menu BlockThe creation of a menu automatically creates a new block. Blocks are containers that allow certainc...
Changing Permissions of a BlockI don’t want the original navigation menu to display to anyone but administrators. It doesn...
The front page has come a long way.Hiding the Login BoxFor security reason you may not want the login box to ever display....
Advanced DesignThere are many ways to rearrange content on a Drupal site.The module panels http://drupal.org/project/panel...
Appendix 1Drupal 7 Licensing Site Recipehttp://drupal7demo.fcla.edu/Installation:Aquia : http://www.acquia.com/downloadsMo...
Appendix 2Getting StartedOne way to easily start playing with and practicing with Drupal is to use a desktop installation....
During the installation process remember the user name and password entered into the installationwizard. This is the user ...
Go to a modules project page on drupal.org.Scroll to the bottom of the page and download the recommended release. The demo...
To install the module in Drupal open your site from the Dev Desktop control panel. Login to the siteusing the user name an...
Choose the module you downloaded from the Drupal website, in this walk through Views, and then clickinstall.The modules us...
Scroll down the page and find the newly installed module. Click the checkboxes to enable.If you look at the description yo...
Remember to save! The save button is at the bottom of the page.Installing the rest of the modules for the demonstration fo...
Upcoming SlideShare
Loading in...5
×

Creating a licensing database using drupal 7

3,616

Published on

Making a licensing database as step by step training for Drupal 7 beginners. The site recipe and getting started document are in the appendix of the Full walk through.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,616
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Creating a licensing database using drupal 7"

  1. 1. Creating a Licensing Database UsingDrupal 7 – NASIG 2012By Amanda Yesilbas, Florida Center for Library AutomationContentsAbout the Installation ................................................................................................................................... 3Important Terms in Drupal ........................................................................................................................... 3Getting Started.............................................................................................................................................. 5 Creating and Approving Accounts ............................................................................................................ 5 A note on account creation - Take a moment to check security .......................................................... 7Turning on Modules ...................................................................................................................................... 8Creating Basic Content ................................................................................................................................ 10 Finding Already Created Content............................................................................................................ 12 Editing Existing Content .......................................................................................................................... 13Creating Custom Content Types ................................................................................................................. 13 A special field ...................................................................................................................................... 17 Field Groups ............................................................................................................................................ 18Permissions ................................................................................................................................................. 21 Permissions by Fields .............................................................................................................................. 21 Permissions Based on Taxonomy ............................................................................................................ 24 Assigning Taxonomy Permissions to a Role ........................................................................................ 27Views ........................................................................................................................................................... 29 Creating a list of Vendors ........................................................................................................................ 29 Creating a Table View with Exposed Filters ............................................................................................ 32 Rewriting Field Output ............................................................................................................................ 36 Adding exposed filters ............................................................................................................................ 38 Adding a Block or Other Iteration of a View ........................................................................................... 41 Adding Contextual Filters (or how not to create the same view a million times) .................................. 41Putting It All Together ................................................................................................................................. 46 1
  2. 2. Changing the Front Page ......................................................................................................................... 46 Making a Menu ....................................................................................................................................... 51 Enabling the Menu Block ........................................................................................................................ 53 Changing Permissions of a Block............................................................................................................. 54 Editing Already Made Blocks................................................................................................................... 54 Hiding the Login Box ............................................................................................................................... 55Advanced Design......................................................................................................................................... 56More Tutorials and Help ............................................................................................................................. 56Appendix 1 .................................................................................................................................................. 57Installation: ................................................................................................................................................. 57Modules Added: .......................................................................................................................................... 57Appendix 2 .................................................................................................................................................. 58Downloading Aquia ..................................................................................................................................... 58Installing New Modules .............................................................................................................................. 59 2
  3. 3. About the InstallationThe demonstration is using the pre-packaged Aquia version of Drupal found athttp://www.acquia.com/downloads. This choice was made so participants would be familiar with theAquia look and feel, so they can easily use Acquia’s Dev Desktop software for easy experimentation andpractice after the session.For more about the Dev Desktop tool, including installation, see the Getting Started Handout.Important Terms in DrupalDrupal has its own unique lingo that can be confusing to newcomers. Here is a list of terms which mightbe helpful. 1. Modules - http://drupal.org/glossary#module Software (usually PHP and CSS) that extends Drupal features and functionality. Drupal distinguishes between “core” and “contributed” modules. Core- http://drupal.org/glossary#core The files and modules included with the Drupal project download. Contrib - http://drupal.org/glossary#contrib Contributed. Modules or themes that are not part of the core Drupal product. Contributed modules and themes are available for separate download from the modulesand themes sections of Drupal.org downloads. These are separate from the Drupal “core”, although over time they can become part of it. Similar concepts exist in other software and are sometimes called “plugins”, “add-ons” or “extensions”. 2. Node - http://drupal.org/glossary#node A piece of content in Drupal, typically corresponding to a single page on the site, that has a title, an optional body, and perhaps additional fields. Every node also belongs to a particular content type, and can additionally be classified using the taxonomy system. Examples of nodes are polls, stories, book pages and images. 3. Fields- http://drupal.org/glossary#field Elements of data that can be attached to a node or other Drupal entities. Fields commonly contain text, image, or terms. In plain speak, this is an individual piece of data on a content type. Ex: The zip code on an address form. 3
  4. 4. 4. Content Type- http://drupal.org/glossary#content-type Every node belongs to a single “node type” or “content type”, which defines various default settings for nodes of that type, such as whether the node is published automatically and whether comments are permitted. Common "Content Types" that just about any website would have include: blog post and page. Content types can have different fields and modules can define their own content types. The core Drupal Book and Poll modules are two examples of modules that define content types. In plain speak, these are the forms you create to input a specific kind of information. In this demonstration we make a license and vendor content type. To add data into the database, we click the content type of the kind of information we want to add and are presented with a predefined form.5. Blocks – http://drupal.org/glossary#block The boxes visible in the regions of a Drupal website. Most blocks (e.g., recent forum topics) are generated on-the-fly by various Drupal modules, but they can be created in the administer blocks area of a Drupal site. See the documentation for more information on blocks. Additional information: Blocks are one method to arrange content on a page. They can be dropped in predefined areas. Blocks is under structure.6. Theme - http://drupal.org/glossary#theme A file or collection of files (PHP, INFO, CSS, JPG, GIF, PNG), which together determine the look and feel of a site. A theme contains elements such as the header, icons, block layout, etc. Drupal modules define themeable functions which can be overridden by the theme file. There are additional themes available in the themes section of downloads.7. Taxonomy - http://drupal.org/glossary#taxonomy The science of classification. In Drupal, Taxonomy is a powerful core module that gives your sites use of “terms”, organizational keywords known in other systems as categories, tags, or metadata. In Drupal, these terms are gathered within “vocabularies.” TheTaxonomy module allows you to create, manage and apply those vocabularies.8. Roles - http://drupal.org/glossary#roles Sets of permissions that can be applied to individual users. Users can belong to more than one role. Two roles, authenticated users (those users that sign up for an account) and anonymous users (those either without an account or not logged in), are supplied by default with Drupal installations. Drupal allows creating additional. 4
  5. 5. Getting StartedThe presentation will use a Drupal installation, with all relevant modules already installed, hosted by theFlorida Center for Library Automation (FCLA). The site can be found at http://drupal7demo.fcla.edu/.This site will be available for use after the demonstration.To practice on your own after the session see the getting started document for installing Dev Desktopand modules.Creating and Approving AccountsAll creators of content need and account. On the front page click Create Account beneath the loginform.Fill in the appropriate information and submit. The presenter will give you the proper administrativeroles.Administrators approve new users by clicking on the People link in the administration menu and thenclicking edit next to the user that needs to be approved. 5
  6. 6. Change the user’s status to active and choose what roles the user should have. Make sure to save. 6
  7. 7. A note on account creation - Take a moment to check securityAny new site will automatically be set up to allow users to create new accounts. This might not bedesirable. To check the settings and change accordingly click on the configure option in theadministration menu running across the browser. On the Configuration screen click on account settings. This warning is because I’m using a Dev desktop installation not connected to the internet. Nothing is actually brokenLook over all the settings on this page, but pay special attention to the registration section. Choose thesettings that match your institution’s needs. You may even consider hiding the login block. We’ll get tohow to do this later in the demonstration. 7
  8. 8. Turning on ModulesDrupal gets it’s functionality through modules. Some modules are considered “core”, meaning they arepart of what comes with Drupal. An example of a core module is Taxonomy. Some are “Contrib”,meaning they are modules created by the Drupal community. An example of a contrib module is Views.Modules need to be enabled to use. For this demo the contributed modules have already been installedand need enabling. For this demonstration we will enable the modules Chaos tools Suite, Date, FieldGroup, References, Taxonomy Access Control, and Views.Later we will enable Fusion Accelerator, Fusion and Panels in a discussion about arranging content.To enable, click on the Modules item in the administration menu. This takes you to a list of all theinstalled modules on the website. 8
  9. 9. Scroll down the list and find the modules that need to be activated. Note that many of these moduleshave multiple parts. Enable all parts of the module by checking the boxes. Remember to save at thebottom of the screen.The Date module has many parts.Some modules require a extra step. After saving this warning appeared.Click the Rebuild permissions link and follow the instructions to finalize the process. 9
  10. 10. Now we will disable a module. Go to Modules from the administration menu at the top of the browser.Scroll down on the module page and find Acquia Network Connector. Uncheck Acquia Site ProfileInformation and save.Then go back to the Module page and uncheck Acquia agent and save. This will make the advertisementgo away.Creating Basic ContentTo create a simple page using the Drupal defaults, click the add content link on the left navigation menu.If you can’t find the left navigation menu make sure all overlays are closed and click the site logo, hometab, or home breadcrumb. 10
  11. 11. Choose create basic page.The red star indicates a required field. The top part of the form is the content of the webpage.The bottom part of the form gives options about publishing. 11
  12. 12. Saving your content will take you to the completed webpage. That is all it takes to make a basic page inDrupal.Finding Already Created ContentNow navigate back to the home page. How do you find the content you just created? To see all thecontent on the site click on the Content menu link from the administration menu. There you will seeyour webpage.Clicking on the title will take you to the page or clicking to edit will take you directly to editing.New content can also be created from the content page. 12
  13. 13. Editing Existing ContentIf you are logged on and an authorized user, you will see the edit tab on a piece of content. Click the tabto go to the edit screen.Creating Custom Content TypesWhile useful, the existing content types in Drupal are limited. You will need to create custom contenttypes. This is the pen and paper portion of working in Drupal.Consider what the data you want to track in Drupal. Break it into logical units. The better you definethese units the fewer headaches you will have. For the license database I need to track vendors,licenses and statistics.Next think about what kind of information is needed to describe each type of information.Example:Vendor –name, contact name, contact email, contact phone number, link to license, link to statistics,login information, notesStatistics – name, type of statistics, file, date 13
  14. 14. License – file of titles, pdf, active dates, date sent to purchasing, date returned, acquisition terms,cancellation terms, ILL terms (make as granular as possible ex. course reserve permissions) andparticipants.The type of information is your content type and the pieces of information on the content type are yourfields.To create a new content type click structure from the admin menu and select content types.Click +Add content type at the top of the content type page. 14
  15. 15. The first screen sets the parameters of the content type. Here is where you name it and set up thebehavior. For the example I am making a vendor content type. Added description Change the title field to vendor name Read and choose settings for content type Save and move on to adding fields. 15
  16. 16. Fields are the information that is part of our content type. Here we add things like the vendor contactname and email. E B A C D A. This is the label. It will be what displays above the field when you create content. B. Be sure to name your field something unique and identifiable. A good practice is to preface the name with the content type name. This makes identification easier. 16
  17. 17. C. There are many choices about what kind of information a field should store. Choose the type that best suits your needs. Ask yourself if you need a drop down list or a free text box? There are also many modules that expand the type. Some contributed field types are date, which adds a calendar pop-up, and node reference. D. Different kinds of fields have different widgets. For example: if you choose date you can have a pop-up calendar or box to type. E. Delete the body tag. This is not needed.After setting your field up click save. This will bring you to more options that allow for furthercustomization of the field. These options change with the kind of field chosenFields can be dragged and dropped to be easily rearranged by clicking on the little cross icons on the leftside.A special fieldNode Reference is an interesting field that creates relationships across content types.During creation you can choose the type of content type to reference. 17
  18. 18. Now, when the license field is clicked on in a vendor record a list of real time licenses appear.Field GroupsToo many fields can make a page unmanageable. A field group allows fields to be grouped together.The groups can then be expanded or collapsed to make reading on a screen more manageable.Adding a field group is almost exactly like adding a field. Go to manage fields on your content type andadd a field group. Save. 18
  19. 19. Once you have created the field group, drag your fields under the field group. They will be indented ifthey are properly placed under the group.Use of field groups will collapse content into more manageable pages. This needs to be done twice.Putting field groups on the Manage Fields Tab will change the edit screen. Adding Field Groups on theManage Display Tab will effect what the users see. 19
  20. 20. Adding Field Sets to the manage display will give you a result similar to this. The page is better looking,and the collapsed groups conserve space on a page.Experiment with the Field Group settings. There are other interesting javascript affects besidescollapsing. 20
  21. 21. PermissionsPermissions control who can see and do what in Drupal. Creation of content and viewing content arecontrolled by permissions. Every time you install a new module take a look at the permissions screen tosee if any new permissions were added.To look at permissions, click People on the administration menu and then click the Permissions tab inthe right top corner.Permissions are assigned to roles and roles are then assigned to users. The top row of the permissionstable shows what roles have already been created. These roles determine what users can do.Permissions by FieldsUsing the Fields Permission module, permissions can be assigned on a field by field basis. This meanssome content can be public and some content can be limited to special user. This exercise will use thelicense content type as an example. On the license some information like price caps or just internaltracking fields may need to be restricted. Other information like interlibrary loan date needs to bepublic. 21
  22. 22. The first step is to make a new role of license viewer. From the permissions page click the roles link justunder the permissions tab. Next type in the name of the role and click add role.To add field by field permissions, go back to the content type license. 1. Navigate from Structure on the admin menu to content type. 2. In the license content type row click manage fields. 3. Click on edit in one of the field rows. 4. Scroll down and find Field visibility and permissions. Select the radio button next to custom permissions. 22
  23. 23. Here we see the roles defined for the site. In this example we only want the license viewer and theadministrator to be able to view these fields. It is good practice to give the administrator access toeverything and in this case the administrator role gets access by default. Check the two boxes forviewing the field. This indicates the license viewer can see but not edit. Remember to save.Repeat steps for all confidential fields.To test, create a new user for the site. Click on People in the admin menu. Then click +Add user atthe top of the page. Create the new user. Make sure to give the new user the role license user.Save.To continue testing:1. Navigate to a piece of license content as an administrator and take a look.2. Copy the url.3. Logout.4. Paste the url into the browser.5. You should only see the publicly available fields6. Login as the new license user7. Now you should see all fields8. Make sure to logout and back in as an administrator to continue. 23
  24. 24. Permissions Based on TaxonomyAnother way to control access to content is through taxonomy terms by using the Taxonomy AccessControl module. In this example we will use it to limit a school to only see their content.Note: This is a higher level of control that will override field permissions. In designing your database, itis important to decide what kind of permissions you need for each content type and create accordingly.For this example let’s assume we want different schools in a consortia to only view their statisticrecords. This requires a statistics content type already be made. Follow the instructions for making acontent type and create one. Include Title, a date that includes a beginning and an ending, a file field toupload a spreadsheet and a node reference field that links to vendors. Leave school off for the moment.After creating the content type add a few records.The next step is to create a new taxonomy. Click on Structure in the admin menu. Next click Taxonomyfrom the list. On the Taxonomy page click +Add vocabulary.Note: The terms taxonomy and vocabulary are used interchangeably in Drupal. There has been someconfusion between versions as to what to call the feature.In this example I’m setting up a list of school names. Save. 24
  25. 25. Next add terms. In this case, terms will be the names of schools. Click the add terms link next to thevocabulary name. Type in the school name and save. Do this as many times as needed.The Taxonomy needs to be added to the content type. This is the same as adding any field. 1. Click Stucture -> content types 2. Click manage fields next to the statistics content type. 3. Add a new field as usual but select Term reference as the type of data to store. 4. Save 25
  26. 26. 5. On the next screen choose the vocabulary Schools. 6. Save the field.Now add a school to the statistic pages you made earlier. Go to the piece of content. Click edit. Fill inthe new field from the school drop down list.The next step is making a new role. Make a new role for one of the schools. People->permissions->role. 26
  27. 27. Assigning Taxonomy Permissions to a RoleTo assign the taxonomy permissions the new role click on Configuration in the Admin menu. Then clickon Taxonomy access control from the configuration screen.Click enable access control next to your school role. 27
  28. 28. Under the heading New, select the term, in this case the school, that the permission will be for. Under the column View click the radio button A. The A stands for allow. Click the Add button next to your school name. Scroll to the bottom of the screen and Save all.A B C A. Choose the term. In this case the school. B. Click add after choosing the term and setting the permissions. C. Selecting A will allow viewing access to anything tagged with FGCU. Now that you’ve allowed the new role to view the content you must disallow it from the other roles. This needs to be done for anonymous and authenticated user. On the Taxonomy Access Control screen click edit access rules next to the role anonymous. Choose the term, the school name. This time, click the radio button under the D for disallow. Click the Add button. Scroll down to the bottom of the page and Save All. 28
  29. 29. Repeat this procedure for the authenticated roles.To test: 1. Create a new user. 2. Assign the new user the school role. 3. Find a statistic page tagged with the school. 4. Logout and try to view page. The page should not appear. 5. Login as the school user and view page. It should appear. 6. Logout and log back in as an administrator.ViewsViews is the real power of Drupal. Technically views is a query builder with a point and click userinterface. This means you can call data from your pages to rearrange and display in dynamic lists. Withexpansion modules the possibilities are endless. You can make calendars, galleries, slide shows, latestnews lists and on and on. Views could be a separate class unto itself.This demonstration will cover a few basic uses of views that introduce some of the features.Creating a list of VendorsOne of the most simple but widely used uses of view is creating a list of a specific content type. For thisdatabase we need a list of all of our vendors.To create a view click Structure in the admin menu. Then choose views from the structure page.Once on the views page, you will see all the preloaded views that come with Drupal and the installedmodules. These can be good models when trying to figure out how to do something the first time. Clickenable to use one of these views in your site. 29
  30. 30. To add a new view click +Add new view from the top of the page. Most of our work for this view will be done on the Add new view screen.A B C D A. Name the view B. This is what you want to make a list of. In this case we want content. Other options include user, commits, files, taxonomy terms and more. C. This field changes depending on what was chosen in the first drop down. In this case it lists all the content types. Choose vendor to create a list of vendors. D. The sort box also changes depending on the first two choices. We want an alphabetical list so choose title as the sort. 30
  31. 31. The second part of the page defines a page that displays the view.ABCD A. Is inherited from the top but can be changed. This is the title that will display on the webpage. B. The URL to access the newly created page. This is created by the page title but can be changed. C. This is where you choose what kind of display your view will take. This is where you can change to output to make a calendar or table display. The second part defines what will be displayed in the format. D. The number of items to display before the list either ends or adds a pager.Check to box to add a block. Mimic the page settings in the page. This can be used later.Save & exit this view 31
  32. 32. This takes you to the newly created view.To find the url of the page again, go back to the view page. Structure->views. The url is displayed in theviews list.Creating a Table View with Exposed FiltersAnother useful view is one formatted as a table. This is a common way to display multiple fields. Thisview will show a table of statistics records that displays title, school and uploaded file. There will also beexposed filters at the top of the view to sort and limit the information displayed. 32
  33. 33. Make a new view. Navigate Structure->Views->+Add new viewThe first part of the form is filled out in a very similar way to the first view we made. The only differenceis we’ve chosen statistics as the type of content.In this view the display format is table. Notice the “of fields” following the display format. This meansfields need to be selected.Ignore the block check box and click continue & edit. 33
  34. 34. This page shows the advance settings for a view. When you come back to an already created view this isalso the page you will see.This view needs to have additional fields added to the display. The title field is already listed under fieldsfrom the initial set up. We need to add school and file. Click the add button next to Fields.This will bring up a list of all the fields in the database. This is why naming fields in content type in adescriptive manner is important. Find the school field and check the box. Click Apply.This will take you to a configuration screen. Take a moment to look at the different choices. Click Apply. 34
  35. 35. A preview of your changes can be seen at the bottom of the screen. It should now look similar to this.Next add the usage statistics file. Again click add next to Fields. You can use the search to find the fieldif you know the name. Click the check box next to the field and click apply. Click apply again at theconfiguration screen.The preview should now look similar to this. 35
  36. 36. Rewriting Field OutputThe file name is very large and cumbersome. The output can be written to just display the word file. Todo this,click on the Stat file field.This brings up the configuration screen. First change the formatter to url to file. 36
  37. 37. Next open up the rewrite results collapsed area. Once opened, open the replacement pattern collapsedarea.The replacement patterns show tokens of the field content. This allows you to manipulate how theinformation is displayed. We are going to change the file into a link using html and the token.AB C A. Make sure to click the rewrite box. If this is not checked the rewrite will not take. B. Here is the html code to rewrite the field output. In place of a url in the href we place a token. Without the code a url would be displayed. With the code around the token the url is populating the code and displaying the hyper link “File” C. This shows the options of data to drop in a display. It will only show options from fields above this one. If you want to display extra data in an output make sure to put the field above it so the token will display.Make sure to click apply. 37
  38. 38. The preview should look something like this.Adding exposed filtersThis list could quickly become large and difficult to manage. Adding exposed filters allows the data to befiltered on the fly. In this example a new exposed filter for school will be added. This will allow the userto instantly get a list from the school they select.Under filter criteria click add.Find the school field and check the box. Apply.On the configuration screen choose dropdown and apply. 38
  39. 39. On the next screen, check the box expose filter. A new set of options will open up. Take the machinefield name out of the label to make it attractive. Apply. 39
  40. 40. REMEMBER TO SAVE YOUR VIEW! The save is on the top of the screen instead of the usual bottom.Updating is not saving.Now take a look at the finished page and make sure it works. 40
  41. 41. Adding a Block or Other Iteration of a ViewIf you want to add a block of a view ofrmake another page of the view with slight changes this is easy todo.Navigate to the view. Structure->Views->edit button next to view.Clicking the +Add button will bring up a list of display types. Choosing one will automatically populatethe new display with the view information.Adding Contextual Filters (or how not to create the same view a million times)If you want to put a link on each vendor page to a view of only that vendor’s statistics you have twooptions. Make a new view for every vendor or use contextual filters in views. This was known asarguments in previous versions of Drupal and is still called that in most discussions and help. 41
  42. 42. We only need a slight variation on the usage statistic view previously made. We need to get rid of theexposed filter and add a contextual filter. Navigate to the already created usage statistics viewStructure->views->edit usage statistics. Click the +Add button at the top of the view and choose page.To delete the exposed filter click Content: School (exposed).Before removing make sure to change the top drop down to “This page (override)”. If it is not changedto override you will change the original view. Click remove at the bottom of the page.Next add a unique path. This will be the url to this view. 42
  43. 43. Now the most important part, add the contextual filter. Contextual filters allows a single view to displayunique information by adding identifying information to the url. In this case, we want to produce a viewbased on vendors.Expand the advanced area and click the Add button next to Contextual filters.Find the vendor field that appears on the statistics content type and check. Apply (This Display). 43
  44. 44. Override the title and breadcrumbs so the vendor is accurately displayed on the view page. Check theboxes next to both and follow the instructions about wildcards. Copy the example. Apply (this display).Save the view. 44
  45. 45. This takes us to a view that looks remarkably similar to what we had before. The power lies in changingthe url.To change the url to pull up a specific vendor we need to know the vendor’s ID number. To find this goto a vendor record and go to the editing screen. Look at the url when in edit mode. Look for the stringnode/a number. In this case the vendor’s ID number is 8.Navigate back to your new view display.The URL should look something like this. 45
  46. 46. Add the vendor number to the end of the URL. This will change the entire view.This is how contextual filters work. Instead of making a new view for every vendor, this one view can bechanged again and again though the url. This makes a site clean and requires less maintenance.Putting It All TogetherChanging the Front PageNow that the content and views are all created, the site needs to come together. The first step ischanging the front page to be something reasonable. For the licensing database being created in thedemonstration we want the view of the vendors to be the front page. 46
  47. 47. First step is to get the path of the view. Navigate to the views list to find it. Structure ->views. Find thepath next to the vendor view.Next, click on Configuration in the admin menu across the top of the page. On the configuration screengo to site information. 47
  48. 48. In the first section of the site information screen, the title can be changed. Change it to LicenseDatabase.The middle of the site information screen is where the front page is changed. Put in the path of thevendor view.Save configuration.Now go to the front page and take a look. The default Acquia logo needs to be removed or changed to anew logo. 48
  49. 49. Click on appearance in the admin menu across the top of the screen. Click on the tab setting in the topright corner.By unchecking the box next to logo, the logo can be turned off. If the logo is to be replaced upload anew image. For this demonstration the logo will be turned off.Save configuration and return to home page. 49
  50. 50. The front page looks better but the menu doesn’t make sense. We want to add a menu that navigatesto different pages. We also want to make the already existing menu viewable only to administrators.Menus are only viewable when they are put into blocks or some other element. The first part is to makea menu. The second part is to put it into a block for display. 50
  51. 51. Making a MenuClick on structure in the top admin menu and click on menus. Here is a list of already premade menus.To add a new menu click +Add menu at the top of the list.Name your menu and save.To add items to the menu click +Add link 51
  52. 52. ABCD A. What is filled in here will be what displays in the menu. B. In this example I am linking to the vendor view previously created. Any path or url can be put here to link within the site or outside the site. C. A description displayed when hovering over the link. D. The weight can force the arrangement of items in the menu. The bigger the number the lower on the list. It is easier to drag and drop links from the menu screen to arrange.Save and follow the same steps to create a link to the statistics view. Rearrange the links into thedesired order after creating. 52
  53. 53. Enabling the Menu BlockThe creation of a menu automatically creates a new block. Blocks are containers that allow certaincontent to be moved around the screen. To see the block go to Stucture->Blocks.Blocks can be put into predefined areas. The predefined areas are defined by the site’s theme. To seewhat areas a site has defined, click on demonstrate block regions. The name is the parenthesis is thetheme name.We want the new menu to appear in sidebar first region. To do this scroll down the page and find thenew block somewhere near the bottom in the disabled blocks area. In the drop down box next to thelicense menu choose sidebar first.The block will automatically move into the new area. To find it again, go to the sidebar first area of theblocks list.To rearrange, drag and drop the blocks into the correct order. In this demo we’ll move the licensenavigation block above the navigation block. Save. 53
  54. 54. Changing Permissions of a BlockI don’t want the original navigation menu to display to anyone but administrators. It doesn’t makesense for people not creating content to see the menu. Permissions by roles can be assigned on theblock page. Click navigation next to the block. Go to the bottom of the screen and choose the roles tab.Check the box next to administrator and save.Editing Already Made BlocksOnce blocks are display you can edit the menu or block from the little cog icon in the top right corner ofthe block.The front page is almost correct now except I want the search box in the header. This can be done bygoing to structure->blocks or by editing the block itself. Click the little cog in the top right corner of theblock and choose configure block.On the configuration page in the regions settings, change the default theme placement to header. Save. 54
  55. 55. The front page has come a long way.Hiding the Login BoxFor security reason you may not want the login box to ever display. You don’t want random hackers orpeople trying to create accounts. The login box can be disabled from the blocks menu. Simply choosenone for the region and it will move into the disabled area.To access your site without a login box add /user to the base url. This will take you to a login screen. 55
  56. 56. Advanced DesignThere are many ways to rearrange content on a Drupal site.The module panels http://drupal.org/project/panels allows the users to create custom layouts through afriendly drag and drop user interface. While simple to set up, this is a large and deep module.Another way to change the look of a website is by downloading and installing a new theme. A list ofthemes contributed by the community can be found at http://drupal.org/project/Themes . Somethemes have advance designs that let a user change colors or add some styling on the fly for a morecustomized look.If you are skilled at css or can manipulate php templates, you can “create” your own theme. This isusually done by downloading a starter theme with good clean css markup like zen or fusion andmodifying the css and php files. The design options are limitless.More Tutorials and HelpThere are many sources of help in the form of tutorials or direct questions.http://groups.drupal.org/ - Find a local group to participate in. These are your best sources for directhelp.Drupal4Lib listserv - http://listserv.uic.edu/archives/drupal4lib.html a friendly and active listserv fordruapl questions. It specializes in library concerns.For staying up to date with new modules, developments and tips and tricks there ishttp://www.lullabot.com/. This company has a weekly newsletter and regular podcasts. They alsoproduce paid training materials and sessions. The Do It With Drupal conference they host is pricey but agood learning opportunity.Nodeone Learning Library - http://dev.nodeone.se/learning-library Free videos and training.Drupal.org – The center of it all.Google - If you Google any problem you have, you are sure to find and answer. The Drupal communityis vast and really into sharing information. 56
  57. 57. Appendix 1Drupal 7 Licensing Site Recipehttp://drupal7demo.fcla.edu/Installation:Aquia : http://www.acquia.com/downloadsModules Added:Views: http://drupal.org/project/viewsField Permissions: http://drupal.org/project/field_permissionsReferences: http://drupal.org/project/referencesField Group: http://drupal.org/project/field_groupDate: http://drupal.org/project/dateTaxonomy Access Control: http://drupal.org/project/taxonomy_accessOptional Modules for DisplayFusion Theme: http://drupal.org/project/fusionFusion Accelerator: http://drupal.org/project/fusion_acceleratorPanels: http://drupal.org/project/panelsAdditional Resources:DLF ERM Initiative http://old.diglib.org/pubs/dlf102/dlf102.htm 57
  58. 58. Appendix 2Getting StartedOne way to easily start playing with and practicing with Drupal is to use a desktop installation. Thissaves you the need to install Drupal on a server and allows for easier experimentation with modules andthemes.The company Aquia provides a free and complete desktop Drupal installation. The advantage of usingAquia’s software is it comes bundled with everything you need to get started, including the backenddatabase. It is a good one-click way for a beginning user to get started.Downloading AquiaThe Dev Desktop installation can be found at http://www.acquia.com/downloads . At this time version7 is the latest version of Drupal. Choose you operating system, download and install. 58
  59. 59. During the installation process remember the user name and password entered into the installationwizard. This is the user name and password for your new site.Once you’ve installed the software go to the new site.Installing New ModulesThe power of Drupal comes from the community created modules that extend the functionality. Thebasic functionality of some essential modules was incorporated into version 7 of Drupal, like CCK. Oneexception is the module Views. This module is necessary for almost every Drupal installation. Thelicensing database in the demonstration uses several modules that can be found on the site recipe card.Modules require separate download and installation. This is easily done in the Dev Desktop. The firststep is to download the module. Links for all modules used in the presentation are provided on the siterecipe card. Since Views is so important, we’ll use this module as the example. 59
  60. 60. Go to a modules project page on drupal.org.Scroll to the bottom of the page and download the recommended release. The demonstration is usingDrupal 7. 60
  61. 61. To install the module in Drupal open your site from the Dev Desktop control panel. Login to the siteusing the user name and password create during the installation. After logging in you will see theAdministration menu across the top of the browser. Click on Modules.This brings you to the modules administration screen. This screen lists all the installed modules on yoursite and indicates if they have been enabled. To install a module click the Install new module linkdirectly above the list. 61
  62. 62. Choose the module you downloaded from the Drupal website, in this walk through Views, and then clickinstall.The modules used in this demonstration.Once a module is installed it needs to be enabled. From the installation finish screen or from theadministration menu, return to the module page. 62
  63. 63. Scroll down the page and find the newly installed module. Click the checkboxes to enable.If you look at the description you’ll see some required modules for views have not been enabled. Thesealso need to be enabled for views to work. Chaos tools is included in the Acquia installation. It is amodule that does not do anything on its own but is required to run many of the more powerful Drupalmodules.Scroll up the page and find the Chaos Tools Suite. Enable all of the tools. 63
  64. 64. Remember to save! The save button is at the bottom of the page.Installing the rest of the modules for the demonstration follows the same steps.Take some time to explore what modules are available. Chances are if you want to do something withDrupal someone else has already created a module to do it. Some modules like reference and dateexpand the core functionality of Drupal while others like views add completely new features. 64

×