Main menu

Background

I wanted to create a view which lists all nodes of different content types that link to the current node displayed on the page. The nodes link via node reference. Since node references only work in one way, and I wanted to get the node references of different content types linking to the current node, I couldn't (didn't know) how to achieve this easily with just a plain view.

The solution I came about was to embed a view to display the different nodes that link to the current one, and feed that view a list of node ids of the linked nodes.

Drupal ships with a lot of great things. One of these is Drupal’s taxonomy system. It allows us to categorise content and build listings automatically. Great for keeping track of our content, and the search engines love it too.

Still, it is not that easy to have the taxonomy listing be exactly how we want them to. Not a shame, we can take control over them quite easily.

It's time to take total control with Page Manager, Panels, Views and some custom "build modes".

Sorry for the “profanity” in the title, but that’s just me getting exited! Drupal is a cool and flexible platform to make powerful websites and webapplications (I may be a bit biased here). But it can be tricky to do a lot of instant, dymamic stuff to (logged in) users. Node.js on the other hand is really good at handling those concurrent actions. And now there is a module that integrates node.js with Drupal.

Views + Quicktabs + Taxonomy + custom code = nice auto generated quicktabs.

We want to show the categorised site’s content in different views. This means each term needs to be a tab. Each tab displays several views. We want it to be generated automatically. Let's see how to do that.

Apr 10 2011

Quicktabs is a nice little module that allows us to create blocks with tabbed content. It has a user interface to create new Quicktab blocks. The Quicktabs can be composed out of normal Drupal blocks, Views or other Quicktabs.

The nice thing is that the content of the Quicktabs can be loaded using AJAX, which might be necessary for performance reasons. The other nice thing is that Quicktabs also provides a little api to create Quicktab blocks programmatically.

Let's find out how to create them programmatically.

Sometimes we want to alter the nodes defined by other modules or created with CCK. Our module might add some specific logic or fields to nodes. It’s great to be able to store and retrieve our data in the node object. It makes our data easily accessible throughout the website.

In Drupal 6 we had the hook_nodeapi that allowed us to change nodes defined by other modules. Drupal 7 dumped hook_nodeapi and gave us specific hooks in return. So how about that?

In Drupal 7 most modules add a short summary under the vertical tabs in the admin pages.

Improving your module’s admin pages by adding the vertical tab’s summary is quiet easy. We need to add some code to our form fields and add some javascript.

Mar 30 2011

Drupal is nice! I just realised how easy it is to save content type specific settings. That is, settings that you want to store in Drupal’s variables table for each content type.

Instead of creating a submit function to store your settings in the variables table, Drupal will do that just for you automatically!

We’ve already seen how to hide a menu-item and change it’s tittle. Now I’ll show how to alter the permissions of an existing module.

This could be useful when we want finer grained control over the permissions we give to users.

Pages

Subscribe to RSS - drupal