HowTo
HowTo remove the post information from a node:
Go to Theme Settings admin/build/themes/settings and then uncheck boxes in "Display post information on"
HowTo modify the look of posted nodes in OG:
Copy og/theme/node-og-group-post.tpl.php into you theme and modify it.
HowTo set a form value without showing a field nor using a hidden field:
$form['plan_code'] = array('#type' => 'value', '#value' => $plan_code);
HowTo check a checkbox:
$form['#attributes'] = array('checked' => '1');
HowTo check if a user has a role: if (in_array('anonymous user', array_values($user->roles)))
HowTo print a variable on a page:
echo '<div><pre>'. check_plain(print_r($variables , 1)) .'</pre></div>';
Use get_class_methods(), get_class_vars() or get_object_vars() if the variable is an object.
HowTo get the node ID from the URL:
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nodeID = (int)arg(1);
}
HowTo create a new node type:
Use the node_example.module as a guide.
HowTo use the color module in your theme:
Read Steven Wittens’ book page Integrating color module and watch the Color Module Integration screencast on Drupal Dojo
HowTo insert a new menu programmatically:
Create a new menu, call it footer-links
<?php echo theme('links', menu_navigation_links('menu-footer-links'), array('class' => 'links')); ?>
- Login to post comments