Difference between revisions of "Drupal documentation"
From Stadm
Jump to navigationJump to searchLine 10: | Line 10: | ||
* use View to format blocks and pages | * use View to format blocks and pages | ||
− | The steps I | + | The steps I followed: |
# Create a content type of 'news' | # Create a content type of 'news' | ||
## Login as Site Admin | ## Login as Site Admin |
Revision as of 16:05, 22 November 2010
Documenting procedures on using Drupal to create the new ERI website
Creating News Items and a News List
- Drupal does not have existing news content type
- Need a content type for Date and PI
- Some tutorials
- use View to format blocks and pages
The steps I followed:
- Create a content type of 'news'
- Login as Site Admin
- Go to Administer/Content Management/Content Types, click Add
- Name: News, Type: news (try to use all lower-case for the type), Description: News articles submitted by administrative students
- Workflow setting: Check 'Published', Disable 'Comments'
- Save the content type
- Add custom fields
- click on 'Manage Fields'
- Add in specific field labels and names for 'News', in this case, I created 3 custom field types: Date, PI, URL
- You can set the size of the text field and whether it is required or not
- Add some news
- click on 'Create Content' link and create some news items
- Create the default view in the VIew module
- go to Adminster/Siting building/Views
- click add to create a new View
- View name: News_list, View description: listing of recent news, View tag: News, View type: Node, Click Next
- Click on the '+' sign next to Fields. Scroll down and select Content: Date, Node: Title, Content: PI and click on the add button.
- For Content:Date, select Widget label (Date), and leave the rest to default
- For Node:Title, remove the label of 'Title' (clear the text). Check the box 'Output this field as a link' and check 'Link this field to its node'
- For Content: PI, select Widget label (Date), and leave the rest to default
- Click the '+' sign next to Filters. Check Node: Published and Node: Type. These options let us choose to display only Published content (Node: Published=Y) and only news (Node: Type='news') then click add
- For Node:Published, click 'yes' for published item
- For Node:Type, select 'Is one of' and check 'News'
- Now let's sort the news items by most recent first (descending order) Click on the '+' sign next to Sort criteria
- Check Content:Date and click add
- Select descending and click update
- Create the page view in the View module
- Select page under the Defaults and click Add Display
- In the Basic setting, change the Name to news_page, Title; Recent News, Style: Table, Item to display: Unlimited (type 0)
- Then check sortable for Fields: Date, Title, PI and select the Default sort to be Date
- Check 'Override normal sorting if click sorting is used' and select Default sort order to be Descending
- In the Page setting, make the changes to 'Path: news' and 'Menu: Normal: news' and select Menu to be Primary Links
- Click update and save
- Create a block for the most recent 5 news to display on the homepage
- Select block under the Defaults and click Add Display
- In the Basic setting, changethe Name to news_block, Title; Recent News, Style: Table, Item to display: 5, More Link: Yes
- click update and save
- Go to Site Building/Block,
- Scroll down to the list of inactive blocks and find the one named ‘news_list: news_block’. This is what we created when we built our view in the previous steps. Click on the dropdown box and select ‘content bottom’ (depending on where you want to place the block).
- Click on configure for 'news_list: news_block'. Scroll down to ‘Page specific visibility settings’ and click on ‘Show on only the listed pages’ and type <front> in the text box.
- Click the ‘Save blocks’ button at the bottom of the page.
Panel issues
- inserted images did not show up
- fix - need to select "Full Html" rather than "Filtered Html" in "Input Format"
Custom fields of content type issue
- the custom fields of a content type did not show up when I tried to create a new content of this content type
- fix - need to enable permissions of these fields in the User Management-Permissions