-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
372 select directory channel view #384
base: 3.x
Are you sure you want to change the base?
Conversation
… and bundle info.
… view based on the channel node.
Pushing this to get eyes on the general approach. Still to do:
|
So to summarise what you're doing here:
Which technically seems fine. Beta module, but not an un-used beta module. It also maybe does more than we need, but could be helpful elsewhere in the future, so better to standardise. It's backward compatible. It leaves it possible to extend to a point you could make another directory channel type with/out the field, so maintains that sort of flexibility. Which means the change to the UX is that:(If the field exists) A content editor creating a new directory will have to select a view using viewfield to decide how the directory is displayed. The proposal is to add a widget that doesn't show the advanced. The display mode is fixed by default to show only 'embed' types which makes sense. The default does show all views, which we probably don't want, but restricting them you get: and I think we're going to need to change the names of the view and the embed display modes here to be more user friendly. And with maybe the titles of the fields too @msayoung do you have any thoughts about this? Like how the widget could work? The reason for this is putting events into directories, which will need yet another view. So is unlike the magic we now do (swap the view based on things in the directory), the content editor creating the directory would decide how it is displayed too. |
|
Yup, the logic is:
|
Added a test. Still to do -- test the bundle info functionality. |
In localgov_paragraphs we're using viewsreference so I wonder if we should use one or other module? https://github.com/localgovdrupal/localgov_paragraphs/tree/2.x/modules/localgov_paragraphs_views We also need to review the labels of the fields used there, which I think are also not very user friendly. |
Extending the requirements to generaizing for 'Finders'
|
Not only does it want to be able to embed them; but I realize you then want to be able to enable / disable on the content types display modes, per mode. That'll be more difficult with a multivalued field. So maybe it wants to be a field type we control, and the names of them can be specific to the particular finders, bonus of having different config rules (what views make sense). |
We need more than one view display on some nodes? |
Why not? Listing with map, just map listing, a page for current consultations, a page for past consultations... |
I wouldn't use field deltas for that use case -- too brittle. Something semantic would be better. Simplest would be just to have separate fields, one for each view. Or -- and this might be over-engineering -- a field where we can mark each view display for its meaning. So each value is of the form:
I suppose the advantage of that over the multiple fields method is that it's customizable per-node, and they can be reordered per-node. But I'm worried I might have reinvented Paragraphs :/ |
That could also have a label we can use in the UI if we're offering a choice between them. Although you could get that from the view, I guess. |
Do you mean that the 'meaning' field property would offer things from a dropdown? Yes, that would make sense as we'd need to have different kinds of theming or layout for them. |
Are there two things here?
I think both a valid use cases. The former having the bonus of the user being able to have flexibility. The later the bonus of not loading all the things on the same page, when they might not be shown by default (which for some of this stuff is performance important). |
I think there's three levels here:
|
Yup, so I think in this MR or another I'd started something along those lines:
|
I think you're both not including the display mode example I included? |
Would that not be just as easily made with two different nodes? How much content is there typically apart from the embedded view? |
I'll answer this upside down
Sometimes some, but not much, it's mainly configuration in which case the examples below could probably be done by creating routes to the views themselves, rather than using view modes. Negating my concern. So not different nodes, but using the views directly from the path.
But for the examples: I didn't give an example of embedded views, but could probably see that happening with news, or blog, channel nodes that are displayed within other pages. But both node route and embed could just be directly views, directly even embedding fields from the node in the header if needed I guess. |
So only question now might be: our own field from scratch, extend Viewfield that was used on this original patch, or extend Views Reference Field that Maria pointed out we are already using elsewhere? |
I looked at both of those modules when making this PR, as both are in my local setup. I don't remember why I picked Viewfield over the other one, but I'll have a look. |
Think moving discussion onto: localgovdrupal/localgov_finders#2 makes sense. |
I've compared both modules and I can't see significant differences between them. Not sure why I preferred one or the other at the time -- maybe I was put off by the stuff about Paragraphs on the project page. This MR will need to be redone anyway for Finders, and it should change to use Views Reference Field instead, since that's already in use in LGD. |
PR for #372.