I'm working on a project where it would be *extremely* handy to be able to find and list nodes as definition lists, in addition to tables and unordered lists. Ideally one would be able to add arbitrary fields to both the term, and the definition areas, as well as specify separate CSS classes for the dl, dt and dd on a per-view basis.

If I was more familiar with the code base I would create this myself -- as it stands I'm going to try to hack the UL code to get the current version "close enough."

If one of the "real" developers is interested I may be able to secure a budget to help motivate a little attention to this feature request :-)

(background: I'm creating a course list. Each course is a node with fields for name, course number, credits and description. I'd like to use a view to create the list with everything but the description as the term, and the description as the definition. I can then use JQuery to collapse/open the definitions. This works well with all courses hard coded into a list in a single node, but what fun is that?)

Comments

dquakenbush’s picture

Solved the display portion, but would still love to see definition lists in Views. My way-too-global solution:

- update jquery
- make sure the title has a link
- fiddle with css-wizard to suppress and arrange

the way I want them -- all inline except for the body.
- put this in the bottom of drupal.js (is there a better place for this?)
/**
 * Toggle the visibility of a sibling <div> using smooth animations
 * created for course descriptions based on a view -- will apply to any
 * list view.  Make sure the title is a link, and it will unfold the node body
 * beneath the headline.
 *
 * fired on document load...
 */

//<![CDATA[
	$(document).ready(function(){
		$('li .view-data-body').hide();
		$('li .view-data-title').click(function(){
			//we have lots of divs inside a single li. 
			//This selects all the items in the current li and
			//filters by the CSS class .view-data-body created by the views module.
			$(this).siblings(".view-data-body").slideToggle('fast');
			return false;
		});
	});
// ]]>

Will link to a demo when the site moves out from behind the firewall.

sun’s picture

Status: Active » Closed (won't fix)

New view types can be added through 3rd party contrib modules, such as Views Bonus Pack, or by theming individual views.