Skip to content Skip to navigation

Simple Election Reform

Election reform notion (not that I expect this to happen): ballots should be blank, no party names, not even candidate names. Voters have to write in who they want, legibly and correctly spelled. This would remove 99% of the stupid from elections such as people who are illiterate, people who vote for the party without even knowing the name of the MP running for their riding, and people who can't spell to save their lives.

The neo-cons would be in ruins.


Random Images from an Image Field in a Block in Drupal 7

The Problem:
Displaying a random image from the image field in a certain node type (where not every node has an image) in a block.

My Solution:
1. First thing is create a view with the following "Default" settings:


Creating a Page Template Suggestion for a Specific Node Type in Drupal 7

Add the following function to the template.php for your theme:

function yourthemename_preprocess_page(&$vars, $hook) {
 if (isset($vars['node'])) {
 // If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
  $vars['theme_hook_suggestions'][] = 'page__'.$vars['node']->type;
 }
}

 
Change the "yourthemename" in the function name to match the name of your theme.


Pages

Subscribe to Front page feed Subscribe to Front page feed