Skip to content

Instantly share code, notes, and snippets.

@illmatix
Created June 24, 2015 23:53
Show Gist options
  • Select an option

  • Save illmatix/1710a0e4683f8c1b073a to your computer and use it in GitHub Desktop.

Select an option

Save illmatix/1710a0e4683f8c1b073a to your computer and use it in GitHub Desktop.
<?php
function ss_menu_location_menu() {
// Generic drink paths
$day_of_the_week = strtolower(date('l'));
$parent_term = taxonomy_get_term_by_name('Drink Menu');
$child_term = taxonomy_get_term_by_name(date('l'));
$items['drink/drink-menu/' . $day_of_the_week] = array(
'title' => 'Drink',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(NULL, array_shift($parent_term), array_shift($child_term)),
'access arguments' => array('access content'),
'weight' => -48,
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'main-menu'
);
$items['drink/%ss_menu_location_term_name/%ss_menu_location_term_name'] = array(
'title' => 'Drink',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(NULL, 1, 2),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment