Drupal Theme from Scratch Drupal Theme from Scratch icon
Theming a Drupal 7 Website



Useful Drupal Tidbits

404 Error Pages

For custom 404 Error pages, just create a content type for it (I went with 'simple page'), create a template for that type (node--simple-page.tpl.php), then create a new node of that type, call it "404 Error" and use that node's ID to set Drupal's default 404 Error page (Administration > Configuration > System > Site Information). Do the same for 403 Access Denied pages.

Drupal's Error Pages settings


Overlay Module

I disable the Overlay module due to the fact that it causes Javascript issues with the admin theme. And because I personally find it to be a pointless feature.


Drupal Modules I Recommend

  • Add Another (presents users with an option to create another node of the same type after a node is created)
  • Administration Menu (a better admin menu bar - make sure to deactivate Core's Toolbar module afterwards)
  • Bean (adds the ability to create custom blocks that resemble mini content types)
  • Better Exposed Filters (adds the option of checkboxes/radio buttons for Views filters)
  • Chaos Tools - CTools (required by many other modules)
  • Date + Calendar
  • Devel (adds development tools to the backend - shouldn't be used on a live site)
  • Entity Reference (adds a field type for referencing other content)
  • Field Collection (helps cut down on the field types used by embedding them within Field Collections then using the collections in the content types)
  • Field Group (helps organize the backend by grouping fields together)
  • IMCE + IMCE WYSIWYG API Bridge (adds image upload and insert option to wysiwyg)
  • Insert Block (adds ability to insert blocks into the WYSIWYG using a shortcode snippet)
  • Jquery Update (provides ability to update to a newer version of Jquery rather than using the version in Drupal Core)
  • PathAuto (converts node URLs into search friendly text-based URLs)
  • Publication Date (adds a field to store and access the publication date - helps with sorting nodes by publication dates rather than creation dates)
  • Security Review (checks your Drupal installation for basic security issues)
  • Shortcode (provides a shortcodes filter framework and API to use within the WYSIWYG)
  • Views (provides the ability to call up specific content dynamically)
  • Webform (easily add complex forms to your Drupal site)
  • XML Sitemap (creates and updates a search engine friendly XML file)

Date Module

To add the dropdown function for hourly selections, I downloaded the Jquery Timepicker v1.2.2 and had to rename the 2 files to be this...

jquery.timepicker.css
jquery.timepicker.js

...and installed them in libraries > wvega-timepicker.

The Date module has a known issue with its time zone handling. To avoid the issue of being 4 hours off (in my case) when displayed on the page (but yet remains correct in the database), when setting up a date field, have the "time zone handling" dropdown set to "no time zone handling."


Date Formats

Date Formats are controlled under Configuration > Regional and Language > Date and Time > Formats and click "Add Format." Here is where you can create a new format using PHP's date formatting characters. We can create as many as we need for different scenarios. These are the ones I've created so far...

Admin Title: Visual Example (PHP code)
--------------------------------------
Month and Date: May 21st (F jS)
Month Abbreviated: May (M)
Hours and Minutes: 5:39 PM (g:i A)
Date: 21st (jS)
Numeral Month: 5 (n)
Abbreviated Month and Date: Jun 6 (M j)

Search Settings

Make sure your settings under Search has 'Active Search Modules' include 'node' and that 'Default Search Module' is set to 'node'. This is under Configuration > Search and Metadata > Search Settings. Also make sure the site has been fully indexed, otherwise new content is not searchable.


*If you do not see the social network icons here, it is because you have an ad-blocker running. Deactivate it for this site if you want to share this link. It is safe. There are no ads on this site.


Comments are welcome... Comments



This documentation is a work-in-progress. As I continue to learn more about the software, I will try to keep this documentation updated. I'm no expert of anything, so if anyone feels they need to correct me about something I've written or wish to add some additional tips, feel free to mention it in the comments.

"Drupal 7 Theme from Scratch" was written by TenTen71 because no one else would.