Modulettes

Some things just can't be developed as a full-fledged module...
Sometimes a hard-coded argument is required (e.g., specify vocabulary for a view), sometimes the code just needs further development to create a nice, general-purpose module.  In any case, these small "modulettes" are less than a full-fledged module, but more than simply a snippet.  They all perform some custom theming, often for a summary view of some sort. 

Directory View

Summary

This module creates a view of nodes by-category, to form a simple, 2-column directory.

Overview

Requires:

  • a taxonomy to list nodes by category - I use the primary "Category" vocabulary here;
  • a View to select the nodes to be listed in the directory and create a nice layout for them;  I use the 'market_directory' view to select Marketplace nodes, and format them in a "Table" layout.

Options:

  • Any number of columns can be created;  I am using a 2-column display.
  • The "depth" of traversal can be set as the views argument option;  I use a depth of 2 here.
  • A complete listing a all terms is possible; I only list terms associated with some node data.
  • By default, each tree for top-level terms is put into a collapsed fieldset using the term as the legend.  This creates a very tidy, minimalist view of the directory, making it easier to navigate.

Source Code

All code snippets, modules, and modulettes on this site are covered by GPL - see license.txt

The source code is attached below...

Full instructions for installing and using this module are included as comments in the source file.

AttachmentSize
directory_view.zip15.28 KB

Image Gallery Summary View

Summary

This module themes a views summary for a set of image galleries.  The image galleries are defined with a view using an argument (usually Term or User).  The summary view shows a thumbnail of the latest image from each gallery, the page title, last modified date, and number of images in the gallery.  This is nearly identical to the gallery summary provided by the Image module's Image Gallery contrib module.  This can be used to theme per-user gallery summaries or per-term gallery summaries.   I can't think of (and haven't tested) other possibilities, but it should work with any argument type and any node type that defines at least one image where you want a nice looking summary.

  • I just really liked the look of the Image Gallery module's summary page, but I wanted to use CCK imagefield rather than the Image module.  There seem to be a lot of people out there looking for this, but there just were no nice looking summary views available. 
  • All of the theming code was ripped directly from image_gallery.module : http://drupal.org/project/image
  • The module is used, for example,  to create the summary view at: http://lasqueti.ca/photos/gallery

Overview

Requires:

  • a view with (1) a CCK imagefield defined as one of the fields; and (2) a view argument (like Term or User)
  • an imagecache preset named "Thumbnail" (this can be configured in the script)
  • a style-sheet for styling the gallery summary view - I've included image_gallery.css, ripped directly from the Image module.

Options:

  • combine this with the Views Summary Mock Menu modulette for a complete image gallery browsing experience!

Source Code

All code snippets, modules, and modulettes on this site are covered by GPL - see license.txt

The source code is attached below...

Full instructions for installing and using this module are included as comments in the source file.

AttachmentSize
summary_view_image_gallery.zip15.01 KB

Image Titles

Summary

This module "automatically" replaces text titles with an "associated:" image, if a suitable replacement can be found.  It simply converts the title into a filename and looks for that file - if it finds it, it formats the image tag to replace the title.

Overview

Requires:

  • a collection of GIF image titles located in files/images/titles (configurable in script)
  • a call from _phptemplate_variables(), or some other appropriate place, to substitute the title.

Source Code

All code snippets, modules, and modulettes on this site are covered by GPL - see license.txt

The source code is attached below...

Full instructions for installing and using this module are included as comments in the source file.

AttachmentSize
replace_title.zip13.35 KB

View Summary "Mock Menu"

Summary

This very tiny module creates a "mock menu" from a views summary - a menu item is created for each query, or potential argument value, in the views summary.  This is handy for providing a menu that links to the various pages provided when a view has an argument.

Source Code

All code snippets, modules, and modulettes on this site are covered by GPL - see license.txt

The source code is attached below...

Full instructions for installing and using this module are included as comments in the source file.

AttachmentSize
summary_view_mock_menu.zip13.03 KB

Vocabulary "Mock Menu"

Summary

This module creates a "mock menu" from a vocabulary, with links to the terms at a given base-path.  This is very handy for providing a menu that links to a view with a Taxonomy:Term ID argument.

Overview

Requires:

  • a vocabulary to create the menu items from;  I use the primary "Category" vocabulary here;
  • a base-path for the menu links - the term ID will be added to this base-path; my base-path is "marketplace/browse/listings"

Options:

  • most useful when combined with a View using a Taxonomy:Term ID argument;  I use the 'market_listing' view to generate this menu as a "summary view" in a block displayed at the base-path.
  • The "depth" of traversal can be set to limit the menu depth;  I use a depth of 2 here.

Source Code

All code snippets, modules, and modulettes on this site are covered by GPL - see license.txt

The source code is attached below...

Full instructions for installing and using this module are included as comments in the source file.

AttachmentSize
category_mock_menu.zip13.95 KB