Facebook Twitter


Shorten. Manuee – Putting the puzzle together. CCK formatters are pieces of code that allow you to render a CCK field content how you want.

manuee – Putting the puzzle together.

In Drupal 6 this basicaly means a theme function. As an example, we will build a formatter for the field type 'nodereference'. This type of field, which is part of the standard CCK package, allows you to "reference" a node inside another. The formatter that nodereference has by default, prints a standard link to the referenced node. We are going to give the users other options, allowing them choose if they want the link to open in a new window or, if they have the popups module activated, that it opens in a jQuery modal window. Let's call our module 'formattertest'. Step 1: Declare our CCK formatters To do this, the only thing needed is to implement our hook_field_formatter_info() in our module: <? It's important to remember that the array keys you use, in our case 'newwindow' and 'popup', will be used later on to construct our functions hook_theme and theme_. 2.

<? Mustardseed Media Inc. Add a language switcher link to $primary_links. Last updated October 31, 2007.

Add a language switcher link to $primary_links

Created on October 31, 2007.Edited by seanberto. Log in to edit this page. I'm posting this theming snippet that I added to page.tpl.php because it took me so long to debug, given the somewhat complex way that the translations.module api works. That's not a dig on the module - it's pretty amazing! Basically, I have a English/Spanish site and wanted to add a single menu item to my primary links that switches from English to Spanish and vice versa.

This snippet is taken from a zen-based theme I am developing. Looking for support? Cufon your Drupal Theme in 4 Steps. I love Cufon.

Cufon your Drupal Theme in 4 Steps

It's easy, lightweight and fast. Cufon is scripts that embeds external font files in your webpage and it's gaining popularity rapidly. I see more and more implementations it mostly it just looks impressive. The headings on this site are also Cufon. Heads up: you can familiarize yourself with Cufon+Drupal without doing the work, by downloading the Free sooperthemes.com basetheme. Step 1: Downloading the Cufon package You can download the minified version free of charge. Step 2: Get yourself a Cufon font Making fonts for Cufon is easy, you can take any TrueType or OpenType font and upload it to the Cufon Generator.

Filesize can differ hugely between fonts. They may look great, but is it worth the large download time and resulting flicker that may occur during reading. Download the .js file from the generator to your theme folder. Step 3: Invoking Cufon. Using Views Relationships, Arguments, and Attachments. This article is also available in French from KolossalDrupal.

Using Views Relationships, Arguments, and Attachments

There's an incredible amount of functionality that can be provided by the Views module, especially when it is combined with intelligent use of Node Reference fields. When you relate your site's nodes with Node Reference fields, these relationships can be easily leveraged to create some very useful views. I'm going to build a view for a sample music site. In the site, I have 3 related content types for "Band" nodes ("Black Eyed Peas", "Linkin Park", etc...), "Album" nodes ("Back in Black", "Bat Out of Hell", etc...), and "Events" (concerts, television appearances, etc...) Each of these content types has only the minimum fields to demonstrate the Views functionality that is the subject of this article. To associate the 3 content types, both the "Album" and "Event" content types have a Node Reference field that allow their nodes to point back to a "Band" node.

Band Info[Band Name] Albums[Album 1][Album 2][Album 3] Basic Settings. Via positiva. 2bits.com, Inc. - Drupal Development, Customization and Consulting. Drupal, CSS, Web Development, and the Myriad Iconoclasts.