Lab 8: Job Site
In this lab you will get some practice with content types and Views by setting up a job board for your lab website. The job board will allow site users to submit and view job opportunities and to apply online. A custom views will show available jobs in selected departments.
- If you haven't already, enable Clean URLs for your website. This requires telling
Apache2 to allow the use of .htaccess files (such as /var/www/html/.htaccess) to set
configuration options. To do so, edit /etc/apache2/apache2.conf and in the
section set AllowOverride to All. Restart apache and enable Clean URLs in the Configuration administration menu.
- Install and enable Entity, Entity Reference, and Chaos Tools [if it isn't already installed]. Also enable the Entity API module. Make sure Field, Field UI, Number, and List are enabled.
- Create a new content type called "Job". Set the description to "A currently available job." Change the Title field label to "Job title". Disallow comments. Click "Save and add fields."
- Now make some additions and changes to the fields.
Define a Job content type
- Change the Body field label to "Description".
- Add a field labeled Department of type List (text). Set the widget to Select List,
Save, and make the allowable values
Administration Business Computer Science Kinesiology Physical Plant
- Add an integer Salary field. Set the input widget to "Text field". Set the help text to "Enter an annual salary for this position.", the minimum to 0, and the field prefix to "$".
- Add a Contact field. This will be an "Entity reference" field. Set the entry widget to Select list. On the next screen set the target type to User and click "Save..." Set the help text to "Select the person who is the primary contact for hiring for this position." Make it a required field.
- Reorder the fields so that they these fields appear first in the list, in this order: Job title, Department, Description, Salary, Contact.
- Make the Description field last and set its label to "Above". Make the other three fields "Inline".
- Click the gear icon to the right of the salary field and set the thousands marker to a comma.
- Click the gear icon to the right of the Contact field and check "Link label to the referenced entity".
- Move the Department field to the top of the list and Salary just below it.
- Set the salary thousand marker to comma again.
- Set the labels to Inline for Department and Salary. Set the Description label to Hidden.
- Set the Description trim length to 200.
Define a Job Application content type
Set up a job view
Next we'll adjust some settings on the main Views page. Note that you can scroll down to the bottom to see the preview at any point.
- Select Content: Department.
- Click to Display a Summary when the filter value is not in the URL
- Click the "Override title" checkbox and enter "Jobs in the %1 department".
- In the More section, set Case to Capitalize each word, Case in Path to Lower case, and click Transform Spaces to dashes in URL.
Set up an applications view
|Show||Content of type Job application|
|Create a menu link||Checked; Menu: Navigation menu|
In the advanced section add a relationship. Select Content: Author and click Apply. Now you can add the User: Name field to the list of fields. Put the fields in the order Post date, Title, Name, Job.
I will check your lab website directly from the link on the course page.