Pages

Wednesday, August 29, 2012

Drupal Website Building Tips - Part 3


Create a Calendar content page

Using Date Tools to Create a Calendar

  • Create a custom Date and Time format which will display only the time (to be used later for the display fields):
Drupal -> Administer -> Site configuration -> Date and Time -> Locale:Default Time Zone:Choose your timezone -> Save configuration
Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Add Format ->
->Format string: H:i
(This adds a format type to the drop-down selection which only displays hours and minutes.)
Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Add format type ->
->Name: Time only -> Type: timeonly -> Save configuration
Drupal -> Administer -> Site Configuration -> Date and Time -> Formats -> Configure ->
->Time only Date format: (the dropdown box should now show your recently created time format, so select it) -> Save configuration
Note: You must update after creating this content type.
  • The Date Tools Wizard simplifies setting up a Date content type to be used with a Calendar display.
Drupal -> Administer -> Content Management -> Date Tools -> Date Wizard -> Save
Drupal -> Administer -> Site Building -> Views -> calendar_date -> Fields: Content: Date - From date -> Edit -> Format: Time only -> Update
Drupal -> Administer -> Content Management -> Content Type -> Date -> Manage Fields -> Label:Date: Configure -> Default value for To date: Same as From date -> Input format: Your preference -> Global Settings: Required (ticked) -> To Date: Optional -> Default Display: Long -> Save
Drupal -> Administer -> Site Building -> Views -> calendar -> Enable
  • Create some (event) content:
Drupal -> Create content -> Date -> create an event
  • View your calendar to see if it came out correctly:
Drupal -> Administer -> Site building -> Views -> calendar_date -> Edit -> View "Calendar page"
  • Add the calendar to the menu:
Drupal -> Administer -> Site building -> Menus -> Primary Links -> Add item -> Path: calendar-date -> Menu link title: Calendar -> Save
The permissions must be set to see the content. For each user role you wish to access the calendar, you must enable the "access all views" permission:
Drupal -> Administer -> User management -> Permissions -> views module -> access all views
Also, the times will only show up if you specifically enable the field_date views permission:
Drupal -> Administer -> User management -> Permissions -> content_permissions module -> view field_date

Add Forums

  • Enable forums:
Drupal -> Administer -> Modules -> Core -> select Forum module functions to enable
Note: You must update and adjust permissions after module installation.
  • Enable first forum "container", which will contain several related forums:
Drupal -> Administer -> Content Management -> Forum -> Add container -> General Forums
-> Add forum -> Forum Name:Forum_1 -> Parent:General Forums -> Weight:1
-> Add forum -> Forum Name:Forum_2 -> Parent:General Forums -> Weight:2
-> Add forum -> Forum Name:Forum_3 -> Parent:General Forums -> Weight:3
  • Enable Forums on the Navigation menu:
Drupal -> Administer -> Site Building -> Menus -> Navigation -> Forum: tick box -> Weight:1
  • If you wish users to be able to reply to forum posts, permissions for comments must be enabled.

Add Images

Install required modules

  • Make sure "Clean URL's" are enabled:
Drupal -> Site configuration -> Clean URLs -> Run the clean url test -> Clean URLs: Enabled
  • The primary module for images is ImageField, which replaces the older module Image. ImageField works with CCK.
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/imagefield-6.x-3.3.tar.gz
sudo tar zxvf imagefield-6.x-3.3.tar.gz
sudo rm imagefield-6.x-3.3.tar.gz
sudo wget http://ftp.drupal.org/files/projects/filefield-6.x-3.3.tar.gz
sudo tar zxvf filefield-6.x-3.3.tar.gz
sudo rm filefield-6.x-3.3.tar.gz
sudo wget http://ftp.drupal.org/files/projects/imageapi-6.x-1.8.tar.gz
sudo tar zxvf imageapi-6.x-1.8.tar.gz
sudo rm imageapi-6.x-1.8.tar.gz
sudo wget http://ftp.drupal.org/files/projects/imagecache-6.x-2.0-beta10.tar.gz
sudo tar zxvf imagecache-6.x-2.0-beta10.tar.gz
sudo rm imagecache-6.x-2.0-beta10.tar.gz
Note: If you wish these modules to be available to only one subsite, then install them instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Modules -> CCK -> select FileField and ImageField module functions to enable
Drupal -> Administer -> Modules -> ImageCache -> select ImageCache and ImageAPI module functions to enable
  • Install the GetID3 module (required by FileField) and its updated library. Then remove the security-risk demos folder:
cd /etc/drupal/6/sites/all/modules 
sudo wget http://ftp.drupal.org/files/projects/getid3-6.x-1.3.tar.gz
sudo tar zxvf getid3-6.x-1.3.tar.gz
sudo rm getid3-6.x-1.3.tar.gz
cd getid3 
sudo wget -O getid3-6.x-1.7.9.zip http://sourceforge.net/projects/getid3/files/getID3%28%29%201.x/1.7.9/getid3-1.7.9.zip/download
sudo unzip getid3-6.x-1.7.9.zip
sudo rm getid3-6.x-1.7.9.zip
cd demos
sudo rm *
cd ..
sudo rmdir demos
Note: If you wish these modules to be available to only one subsite, then install them instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Site Configuration -> GetID3 -> Path: sites/all/modules/getid3/getid3-1.7.9/getid3 -> Save configuration
Drupal -> Administer -> Modules -> Other -> select GetID3 module function to enable
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/token-6.x-1.12.tar.gz
sudo tar zxvf token-6.x-1.12.tar.gz
sudo rm token-6.x-1.12.tar.gz
sudo wget http://ftp.drupal.org/files/projects/views_gallery-6.x-1.2.tar.gz
sudo tar zxvf views_gallery-6.x-1.2.tar.gz
sudo rm views_gallery-6.x-1.2.tar.gz
sudo wget http://ftp.drupal.org/files/projects/nodereference_url-6.x-1.6.tar.gz
sudo tar zxvf nodereference_url-6.x-1.6.tar.gz
sudo rm nodereference_url-6.x-1.6.tar.gz
sudo wget http://ftp.drupal.org/files/projects/views_attach-6.x-2.2.tar.gz
sudo tar zxvf views_attach-6.x-2.2.tar.gz
sudo rm views_attach-6.x-2.2.tar.gz
Note: If you wish these modules to be available to only one subsite, then install them instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Site Configuration -> GetID3 -> Path: sites/all/modules/getid3/getid3-1.7.9/getid3 -> Save configuration
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/thickbox-6.x-1.6.tar.gz
sudo tar zxvf thickbox-6.x-1.6.tar.gz
sudo rm thickbox-6.x-1.6.tar.gz
Note: If you wish this module to be available to only one subsite, then install it instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Modules -> Other -> select Thickbox module functions to enable

Configure settings

  • Configure ImageCache:
Drupal -> Administer -> Site building -> ImageCache -> Add new Preset ->
-> thumbnail -> Save preset -> Actions -> Add scale and crop -> Width: 150 Height: 150 -> Create Action
Drupal -> Administer -> Site building -> ImageCache -> Add new Preset ->
-> fullsize -> Save preset -> Actions -> Add scale -> Width: 500 Height: (blank) -> Allow upscaling: ticked -> Create Action
Note: You must update and adjust permissions after module installation.
  • Create a Photo content type:
Drupal -> Administer -> Content management -> Content type -> Add content type -> Name : Photo -> Type: photo -> Description: A post that includes a nicely formatted image -> Save content type -> Photo -> Manage fields -> Add field -> Name: photofield -> field_photofield -> Select a field type: File -> Select a widget: Image -> Save -> photofield customization fields: (fill in desired settings) -> Save field settings -> Save
-> Display fields -> Label: (hidden) -> Teaser: thumbnail image linked to node -> Fullnode: fullsize image -> Save
Note: You must update and adjust permissions after module installation.
  • Create an image (Photo content):
Drupal -> Create content -> Photo -> Name: Photoexample_1 -> photofield: photo_filename_1.png -> Upload -> Save

1 comment:

  1. Hey Nitin Sethi, really great thoughts on this topic, I recently blogged about this as well Drupal 8 SMTP Mail

    ReplyDelete

Thanks for your comment.