Status: Fixed
There are now different solutions available:
- Views content DS does exactly as the issue title suggests.
- EVA: These are not content panes, but they are available in display suite. Minor issue with this discussed in #1617030: Make EVA not be a preprocess field.
- ds_extras custom fields: Everything exposed in panels can also be used as a ds custom field. However, this is more work to set up than Views content ds or EVA.
Original issue
Hi,
I am currently in a process of choosing between panels and display suite.
During my experiments, I found that views displays configured with "Views content panes" are available in panels, but not as ds fields.
On the other hand, views displays configured with "EVA: Entity Views Attachment" are available as ds fields, but not in panels.
This means, whenever I change my mind between ds and panels, I have to restart from scratch with my views. (or create a feature and hack the code..)
Do you think it would be possible to have one views display type that takes an entity id as an argument, and that works both in ds and in panels?
Or better, to make views_content displays available as ds fields. Because og_views already uses views_content, not EVA or anything else.
Maybe in the end I will stick with panels, but compatibility with ds would make it easier to compare.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | views_content_ds.zip | 1.59 KB | donquixote |
| #4 | ctools.views_content.ds-support.7-x-1-x.1379560-4.patch | 2.47 KB | donquixote |
Comments
Comment #1
merlinofchaos commentedDisplay suite fully integrates with panels and lets you use panels with panel layouts and the whole set of content.
Comment #2
merlinofchaos commentedIt's possible that the EVA display not showing up in Panels might be due to the entity field support in Panels lacking support for pseudo entities. I don't actually know how that works; that could be a deficiency.
Making content available in display suite would be an issue for display suite. THe content is generic, so it could if it wanted but I think in that particular context it can only use field api fields and pseudo fields.
Comment #3
donquixote commentedCool, thanks for the feedback!
This is some information I can play with.
DS has an api to create fields via custom modules (which is different from the D7 core or D6 cck fields api).
It should be possible for views_content to hook into that API.
This code could live either in views_content or in ds. But definitely prefixed as views_content_*.
When or if my use case gets close to this, I might produce a patch. Either here, or on the DS side of things. We'll see.
Comment #4
donquixote commentedGetting my hands on this task.
If you are interested in this, it would be nice if you could cover some of the views part of this, while I do the ds part.
I would prefer to see this in ctools views_content, but if you want it in ds instead, fine.
One way or another, I would appreciate your support to fill in the blanks for this patch :)
Probably just some views_get_view(), ->set_display() and ->execute() ?
--------
I wonder if it would make sense to restrict to specific bundles and view modes in the view configuration, so we don't crowd the field ui form.
Also, we should make this work for more than just "node", and "entity:node.nid".
Comment #5
donquixote commentedThis obviously "needs work", the patch is definitely not meant to be committed like this.
And, as mentioned, even if you think this should rather go into ds eventually, it would be nice if you could use this issue to help me iron out the views part.
Comment #6
donquixote commentedI made this a custom module.
Both for proof-of-concept, and so I have something to use for my own projects.
The module creates one field per view, for those views that contain views_content displays.
Each display is a formatter.
As a result, one can never have two displays of the same view active in the same view mode.
I think that's an acceptable trade-off, considering that too many fields can make the ds configuration form quite unpleasant to work with.
-----
Now we need to decide, should this be a separate module, or shipped with ctools, or shipped with display suite?
You said this should rather be part of DS, but maybe you want to have a second look, now that a working module is available?
Comment #7
swentel commented@donquixote: you can also use the 'dynamic fields' which is in DS core - it exposes any sort of CTools content type - including views content panes as well, so I think this is indeed a 'closed (fixed)' status.
Comment #8
donquixote commentedNice!
For this specific situation I find #6 to be more convenient.. esp, since there will probably be many views displays to be added this way.
But still good to know.
I wonder, what about providing this as an "empty" row in the field UI form, similar to the one for adding field groups?
Comment #9
donquixote commentedHi,
maybe I am overextending this issue.
I hope something useful can come out of it nevertheless - be it a new feature or module, or just documentation.
I am trying to get this to work with Organic Groups. On a node/%node/something page, I want to show a list of group posts for this specific group.
It should be mentioned that those views that ship with og use the gid as an argument, not the group's nid / entity id. In D6 this used to be the same, in D7 it is separate - a group node of nid=555 might have a gid of 60.
With ctools page manager, I would create a variant of node/%/something, add a context relationship to get the gid, then use the default og views panes with their default argument setup.
Now trying the same with a ds dynamic field, it seems I can not add to the context. Instead, I
However, on ds (with a dynamic field), I can not add to the node context. It seems I have to use nid as the views pane argument.
(and that's the same for my custom module in #6)
Fine, so I add the relationship on the view instead. But which one?
OG views relationships are quite poorly named :( There is og group, og group membership, and other things that seem to be the same but sound different.
------
So, I guess, the names of og relationships is slightly outside the scope of this issue.
What fits in this issue:
- Can dynamic fields context be extended with relationships?
- If I continue with the approach from #6, how could I do it the most generic, allowing other arguments than just nid? (I guess I need to figure this out by myself)
Comment #10
BrilliantMkting commented..I need to know the solution to these problems too. As I'm working with Organic Groups content and views content panes, Or EVA.
I might just stick with panels if it's going to be this difficult to figure out.
Comment #11
BrilliantMkting commentedFrom my understanding, Display Suite doesn't have a "context" system and can't pass arguments (GID in this case) the way that Panels does.. Right?
Comment #12
donquixote commentedAs swentel mentioned above, DS dynamic fields can be used to add ctools content panes.
From my experiments, the context argument that is passed to those content panes is the node nid. The group gid is usually not available, and there is no way to extend the context with relationships - afaik.
That said, I managed to do what I need with my custom "views_content_ds" module, + content panes.
Up-to-date code can be seen here,
http://redmine.bewelcome.org/projects/bw-drupal/repository/revisions/dev...
and the feature
http://redmine.bewelcome.org/projects/bw-drupal/repository/revisions/dev...
This is all open-source, so that's ok to share.
Relevant modules are
views_content_ds
nodeaspect + pageapi
bw_groups
bw_forum (for custom formatters and ds fields)
bwf_groups (feature)
If that helps..
Comment #13
merlinofchaos commentedI just committed a patch to allow the 'extra fields' to be used by CTools.
That should solve the issues with things like eva or anything else that shows up as an extra field that is not actually a field.
See #1377518: add support for extra fields (as content)
I'm going to mark this fixed on the grounds that that fixes the issue. However, if there's something missed we can revisit.
Comment #14
donquixote commentedThis does solve one half of the issue, but not the other half.
1) eva and other things are now available in panels (if I understand correctly).
2) any panel panes are available to display suite via dynamic fields.
Point (1) is fine.
Point (2) still feels inconvenient to me.
It would be preferable having those views displays available ds fields directly, not using some crazy dynamic fields configuration.
Both in D6 and D7, I have my own custom logic for this purpose. In D6, I have my own custom views display type. In D7, I use views_content. Both of this have performance benefits over views_attach / eva, because the view does only load and execute when it is actually needed.
Question is, should I continue to use this only for myself, or should I share it as a module, or should it be included in ctools or ds?
Comment #15
merlinofchaos commentedHaving panel panes available to display suite as fields would be a function of display suite, not panels.
The content is a generic content type system in CTools and anyone that wants to use it can.
I'm also not really sure it's appropriate for display suite but that is not for me to decide.
Comment #17
donquixote commentedFor the record:
I just released Views content DS for exactly this purpose.
For the EVA thing, there is some activity in this issue:
#1617030: Make EVA not be a preprocess field
Comment #17.0
donquixote commentedupdate with status fixed and solutions
Comment #17.1
donquixote commentedClosing the bullets