Support configurable view theme functions

Crell - January 7, 2007 - 09:03
Project:Views
Version:5.x-1.4-2rc1
Component:Code
Category:feature request
Priority:normal
Assigned:Crell
Status:closed
Description

This patch does a number of evil things to the views_theme_wizard module, all of which support each other.

* Refactors the form handling to be a true multi-step form. That allows us to:
* Introduces a new hook, hook_views_theme_wizard_type() that lets modules define alternate theme functions that get generated. That allows us to:
* Implement said hook within theme_views_wizard (creating a very long-winded named function) and define three theme types: Straight (the usual list), Grouped (a grouped list by a user-selected field), and Nested Tree (an unordered-list tree of nodes based on two user-selected fields, usually nid and a reference to a nid).

Because it's a hook, that means other modules can provide their own theme function templates. Alternatively, we can also move the Grouped and Nested Tree types out to the bonus pack, their own modules, or whatever.

Also, I personally hate the name "type" but couldn't think of anything better that wasn't already taken. :-) Input welcome.

AttachmentSize
views_theme_types.patch.txt14.22 KB

#1

merlinofchaos - January 18, 2007 - 06:30
Status:needs review» patch (to be ported)

This is committed to Drupal 5 -- but, um. The patch wouldn't apply to 4.7 and it was a pretty big rejected hunk. Not surprising, since it had to do with forms that are a little different.

Would you be willing, to...you know. Port it back?

Also, if you have a little time -- could you write up a little documentation via hook_help? I think it could go a long way toward explaining what the different types of theme generators are. Obviously one could play with them, but even I wasn't immediately sure what the different options I did.

Oh I renamed 'Straight list' to 'Simple list' thinking it makes a little more sense.

#2

Crell - January 18, 2007 - 07:13

Well, multi-step forms work differently in Drupal 4.7 (somewhat sloppily from what I understand?), so I'm not at all surprised that it died a horrible death when you tried to patch it. :-) I'll see what I can do when I get a chance.

As for docs, how would you want it displayed? I confess to not being fully versed in how hook_help places text, but a description of each theme type would have to be provided by the type, since it's configurable. A better description of what a "type" is could just be added to the existing paragraph.

#3

catch - January 11, 2008 - 14:23
Status:patch (to be ported)» fixed

Can't see this being ported now, so back to fixed.

#4

Anonymous (not verified) - January 25, 2008 - 14:31
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.