Read More

Drupal Calendar -- Click Day to Add New Node From Month ViewCalendar Page


Clicking a day-block within a Drupal calendar page does not provide an easy way to add new events, as one might expect in a modern web interface.

Solution (hack):

- Install and patch the Prepopulate module to handle date fields. This allows for the passing of dates from the calendar into a "Node Add" form using URL paramaters. A new "Add Event" URL can be created for each day on the calendar view page.

- Copy the calendar template file calendar-datebox.tpl.php into the theme directory and reformat things to handle the new Preopulate values.

- Be sure to check a user's role and only display the new "Add Event" link for members of selected roles.



Bell Boy

Read More

JQuery Code Snippet For Select Lists

This code will help display a special note when a specific value from a select list is chosen. In this example, some note text is added to the page, near the form save button.

This script can then be set in a Drupal "code" block, with conditions for only displaying on our node add/edit form page.

(function ($) {
if (this.value == 'some_value_from_select_list')
$('<div id="special_note"><H1>Special Note:</H1> Note text here. </div>').insertBefore('#existing_div_id_of_where_to_place_on_page');
} else if ($('#special_note').length){
// Check for length (existence) of our note div.
// This removes our note if the value is selected and then changed to another value.
$("div").remove( "#special_note" );

Kt, Tag, Morse Code, The Shack, Glue Box Telephone

Read More

Philadelphia Frequencies & Repeaters

This post contains a bunch of frequency notes from our radio channel memory. It won't mean much for most.

Read More

PHP Snippet print drupal custom search block

This code can be used to print Custom Search blocks any where you can stick PHP. Tested in Drupal 7.

#open php code

$block = block_load('custom_search_blocks','1');
$content = _block_get_renderable_array(_block_render_blocks(array($block)));      
$output = drupal_render($content);        
print $output;

#close php code


Subscribe to Front page feed