Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Implements hook_views_pre_execute().
- */
- function MODULENAME_views_pre_execute(&$view) {
- // Set the first contextual filter value.
- $view->args[0] = 1;
- }
- /**
- * Implements hook_views_pre_execute().
- */
- function mymodule_views_pre_view(&$view, &$display_id, &$args) {
- if ($view->name == 'VIEWNAME' && $view->current_display == 'DISPLAYNAME') {
- $url = arg();
- if (isset($url[1])) {
- // YOU MIGHT HAVE TO ADJUST $url[1] TO MATCH YOUR URL ALIAS.
- if ($normal_path = drupal_get_normal_path($url[1])) {
- $path_args = explode('/', $normal_path);
- }
- }
- if (isset($path_args[1])) {
- $view->args[0] = $path_args[1];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement