Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. function THEME_preprocess_node(&$variables, $hook)
  2. if (preg_match('//ARGUMENT$/', check_plain(current_path()))){
  3. $variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__ARGUMENT';
  4. }
  5.  
  6. function THEME_preprocess_node(&$variables) {
  7. $variables['theme_hook_suggestions'][] = 'node__' . $variables['view_mode'];
  8. }
  9.  
  10. function THEME_preprocess_node(&$variables) {
  11. $variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];
  12. }
  13.  
  14. function HOOK_menu() {
  15. $items['node/%/argument'] = array(
  16. 'page callback' => 'node_custom_view',
  17. 'page arguments' => array(1, 2),
  18. 'access arguments' => array('access content'),
  19. 'type' => MENU_CALLBACK,
  20. );
  21.  
  22. return $items;
  23. }
  24.  
  25. function node_custom_view($arg1, $arg2) {
  26. $content = '';
  27.  
  28. if (is_numeric($arg1) && $arg2 == 'argument') {
  29. $node = node_load($arg1, $vid = NULL, $reset = FALSE);
  30. $content = drupal_render(node_view($node, $view_mode = 'custom_view', $langcode = NULL));
  31. }
  32.  
  33. return $content;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement