Syndicate content

Intermediate : All

drupal tutorials Welcome to my Drupal Tutorial listing. I have tried to make the tutorials as easy to find as possible by categorizing them by skill level and by the three major areas of Drupal development: Drupal Administration, Drupal Theming, and Drupal Module Development. If you are not able to find the information you are looking for feel free to post a Drupal question and I will do my best to answer it. (Note: you must login or register with this site in order to post content.) Also notice the RSS feed button on the upper right. You can subscribe to individual categories of tutorials by clicking the RSS link while in the selected section.

There are several ways to insert blocks onto a page with Drupal. You can use panels, you can add a region to the theme, or you can call the blocks programmatically with php. Though it might not seem evident at first there are some situations where it really is much easier, or better just to call a block with php rather than using the other options. One good example is where you want to add a particular block to a page that shows up in an odd location (such as the top right hand corner of the page) where panels can’t get to.

Taxonomy is not a common word to hear in the English language, so chances are if you haven’t dedicated your life to studying the mating habits of African dung beetles or tinkering with Drupal then you may not have even heard the word before. Taxonomy refers to a system of classification used to group similar items. In Drupal Taxonomy is used to group your pages by the subject matter or by other criteria so that they can later be sorted into page listings (using the Views module) or manipulated in some other fashion.

In Drupal 6 views has been completely rewritten from the ground up, and as such we have to adjust the little code snippets that we developers have collected over the years to compensate.

The old way ( Drupal 5 views 1 ) of inserting a view into a tpl or into a php enabled content area was as follows:

<?php
$view_name = 'text_listing'; //name of view
$view_args = array($oldstring) ;
$view = views_get_view($view_name);
print views_build_view('embed', $view, $view_args, $view->use_pager, $view->nodes_per_page);
?>

This has now changed to the following:

<?php
  $view_args = array();
  $display_id = 'page_1';
  $view = views_get_view('logo_slideshow');
       if (!empty($view)) {
        print $view->execute_display($display_id , $view_args);
  }
?>

Hi Aaron, came back to use your code on how to insert a View programmatically http://www.pixelclever.com/how-programmatically-insert-a-view-drupal-6

I have come up with a few problems.

I created a view with fields to use the taxonomy term as an argument, then created the View theme templates to display the fields. The view that overrides the the content type shows all the nodes of the content type, and is not picking up the argument taxonomy term from the url (though it does on the live preview in the view)?

Hi,
Is there a way to remove a link from a book page?

So for example here is the book menu:

  • Book
    - Chapter 1 (expands when clicked)
  •   Chapter 2 (expands when clicked)
  •     Alabama (expands when clicked)
  •     Arizona (expanded)
  •      Section 1 (link)
  •      Section 2 (link)

Thanks