Use the following code to load the comment anywhere:
if (function_exists('comment_render') && $node->comment) { print comment_render($node, $node->cid); $node->comment = NULL; }
Use the following code to load the comment anywhere:
if (function_exists('comment_render') && $node->comment) { print comment_render($node, $node->cid); $node->comment = NULL; }
Example of how to load just the exposed views filter:
$view = views_get_view('example_views'); if($view){ $view->set_display('page_1'); $view->init_handlers(); $form_state = array( 'view' => $view, 'display' =>; $view->display_handler->display, 'method' => 'get', 'rerender' => TRUE, 'no_redirect' => TRUE, ); $output = drupal_build_form('views_exposed_form', $form_state); }else{ $output = ""; // error messages or something... } print $output;
Example of how to embed a view using views:
print views_embed_view('example_views', 'block_1', $arg)
How to use imagecache in templates:
theme('imagecache', $preset, $image, $alt)
Example of using hook_theme.
/** * Implementation of hook_theme(). */ function example_theme() { return array( 'example_taxonomy' => array( 'template' => 'example-taxonomy', 'arguments' => array('node' => NULL, 'options' => NULL), ), 'example_taxonomy_terms' => array( 'arguments' => array('voc' => NULL, 'node' => NULL, 'options' => NULL), ), 'example_front_page' => array( 'template' => 'example-front-page', 'arguments' => array(), ), ); }
Example of using hook_menu.
First create a empty page with no menu item.
Nice menus is a module which let’s you have expandable drop-down menus. All you have to do is create your own menu structure. If you want to customise the look and feel you can override some CSS. Please note that in this tutorial I am using the 6.x-2.x-dev release because it’s most up to date version.
The paging module gives you the ability to separate the text within the node body field into pages using the <!--pagebreak-->
tag within the text.
To install this module just go to Administer >> Site building >> Modules and enable the module.
Continue reading “Separate nodes into pages with paging module”
Tab tamer is a module that let’s you control which tabs you want to display or hide. Often when you enable a module it adds an extra tab on the user profile or node page. With the tab tamer module you can control which tabs are displayed.
UPDATE: Setup Tab Tamer on Drupal 7
To install this module just go to Administer >> Site building >> Modules and enable the module.