CCK provides 3 contexts for which different formatters can be selected. FileField's dynamic formatters should do the same. The attached patch is a bumbling attempt at just such a feature. :) I hope it can be a foundation to keep the feature set we get with CCK's formatter system, until we can develop as UI. An extension to the Concept may be to rewrite the CCK Display Settings form to set #type to hidden and set the formatters for each context explicitly and present a like to the field settings form instead of the preset select on the Display settings form...
Alternatively a meta-formatter.module would be nice as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 279288.patch | 25.53 KB | dopry |
| #3 | filefield-file-formatter-presets.diff | 35.04 KB | jpetso |
| filefield-context-formatter.patch | 9.55 KB | dopry |
Comments
Comment #1
jpetso commentedI'm currently working on a patch that moves the file formatter settings out of the field and into a separate admin form for managing file formatter presets. This should fix this issue as well as #277895: Teaser vs. Page aware formatters, #276967: display settings in the wrong place? and filefield_image's #276551: Ability to choose different file formatters in Views.
Not sure if a quick fix like this is the best solution - most importantly, this patch still doesn't make it possible to have different formatter settings for a multitude of different views.
Comment #2
dopry commentedIf we at least get a neater UI, I can work on the views stuff later... :) I wasn't aware that you had started when i was tinkering last night.
Comment #3
jpetso commentedOk, here's a working patch, stealing big time from imagecache's preset, menu and form code. It probably needs some cross-linking for better usability (from/to the "Display fields" and "FileField formatters" admin pages, and probably also from the field configuration form), and also needs a more thorough review than the short glimpse that I gave it just now, but apart from those minor points it seems to work pretty decently.
You might want to give it a shot, otherwise I'll probably commit it in the following few days with nicer messages but with unchanged inner workings.
Comment #4
dopry commentedIs there anyway we can leverage CCK's hook_formatter_info instead of adding the new formatter hook for filefield? I think you could add the extra properties to the array without CCK freaking out...
Do you think this could become a more general metaformatter module, and could work with CCK core by merging the field_types properties of the included formatters. It would give users the ability to write more advanced formatters for all CCK fields, not just filefield... just a thought, but we can start with filefield.
Comment #5
dopry commentedHey that didn't commit to head.. attached is an re-rolled version, but something about the unserialize seems broken... maybe you can take a look and see if you can figure it out.. maybe upgrade path error.
Comment #6
dopry commentedoh yeah...
Comment #7
roam2345 commentedsubscribe.
Comment #8
wuf31 commentedsubscribe.
Comment #9
dopry commentedThis patch is being replaced by a metaformatter module..
Comment #10
roam2345 commentedWhere can we get our hands on this? Or is it still to early?
Regards,
Lathan