This patch makes 2 changes to the Views field configuration (I'll split if necessary).
1) Makes views_handler_field_content a subclass of views_handler_field, basically removing the option to "Link this to node", as the TODO statement is correct, this is a functionality of the formatter, not Views in this case. Considering imagefield/cache would provide a formatter for "as link", and then Views would provided the link to node option as well, my guess is users would user both options and create funkiness.
2) Adds options for labels, which are now a radio button set including: None, Widget label, and Custom. Custom is given the JS handling that it makes the "Custom label" field appear when checked. See screenshot.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | Picture 3.png | 20.36 KB | quicksketch |
| cck_views2_configure.patch | 2.72 KB | quicksketch |
Comments
Comment #1
quicksketchSceenshot didn't attach....
Comment #2
yched commentedhttp://drupal.org/node/278978 was marked duplicate.
I'm still undecided on this. I sort of like the fact any field can be turned into a link to its node, without the need to duplicate each formatter with a 'link' variant. Same old question of 'formatter settings' :-(
I'm wondering about the possibility to add a 'linkable' property to the information that formatters expose in hook_formatter_info().
In the form for the views field, we then make the "Link this to node" checkbox dependent on the fact that the selected formatter is 'linkable' (Views FAPI enhancements lets us do that easily)
That 'linkable' property would only be effective in Views-displayed fields for now, but if / when we eventually do have formatter settings, we could use it to automatically generate a similar checkbox in the 'formatter options' form, without needing every formatter to re-implement it.
Comment #3
yched commentedI committed the 'label' part after a little refactoring (current patch didn't work for multiple values fields - might be because Views / CCK have moved since the patch was posted).
Changed title to reflect the remaining discussion.
Comment #4
karens commentedI was going back and forth on this too. The one advantage of having the formatters create the link instead of doing it here is that it will work outside of Views, like in node displays and in panels. So adding a 'link' option to each formatter might be better than implementing the Views method.
Comment #5
yched commented"So adding a 'link' option to each formatter might be better than implementing the Views method."
Agreed, *if* we had formatters 'options', which we don't for now.
With the current state of CCK, we'd need to duplicate every formatter with an 'as link' version (like with imagefield / imagecache formatters in D5), which I'm not sure we're willing to do for all 'core CCK' formatters.
I think the ability to turn any field value into a link is mostly useful in views anyway : you want to link to the node when you're not already viewing the node. So having 'as link for all fields' only in Views still makes sense.
Other than that, most obvious use case is images in teasers, which is why there was a demand for 'link' image formatters.
Comment #6
karens commentedI meant add another formatter for the two fields that don't already have a 'link' formatter, but I see that's where the need for options comes in since you need a way to both format the display and add an option of whether or not to make it into a link :)
Actually any field in teasers might potentially be a link if you don't want the title to be the only way to link to the node. But most importantly our new Panels implementation might use this so for fields in panels. But Panels 2 for Drupal 6 is not even ported yet, so that's premature.
OK, probably too complicated for now, we need to get a release out and that's more important, so maybe this is a feature request or a future decision. Do we already have a feature request for options in formatters?
Comment #7
yched commentedHm, right, forgot about panels...
The issue for formatters settings is http://drupal.org/node/226154
My proposal of a 'linkable' formatter property in #2 still stands IMO :-)
Comment #8
aren cambre commented#495408: Userreference is linked in Views even when "Link this field to its node" not selected marked as duplicate of this. The current configuration causes confusion. See the duplicate issue for background.
Since this issue is so old, it probably needs to be revisited from scratch, so I changed some of its parameters.
Comment #9
yched commented3.x branch is exclusively dedicated to the work on multigroups.
Comment #10
aren cambre commentedResolution of this issue might help #361298: Grouping field problem when "link to node" enabled.