-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
No way to meaningfully customize EntryCards (list/grid cards) #2868
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
Comments
@MilesRomney - can you submit a PR for this change? Would be great to get this implemented! |
Hey @kylekirkby, yeah I did, but @erezrokah clarified that they follow a carefully planned feature roadmap, and don't accept PRs without long-standing community discussion. (Fair enough.) So it's a non-starter for now. The change is only one line of code (twice). Here's the commit on my fork: MilesRomney@0c6a719 I've packaged this up and made it available on a Verdaccio instance if you'd like to use it. Add a
Then in
(The -beta.3 is the custom version that includes this feature.) You'll also need to add a bit to your build routine in
And then, it's pretty sweet. :) |
Hi @MilesRomney, sorry for not being clear enough. We would love a PR for this (referencing your previous pr for reference), but it should be implemented in a way that is consistent with the other methods of extending the CMS (e.g. |
@MilesRomney take a look at the UI we are working towards in #2557. Would this fit your needs where the columns displayed would be configurable according to entry fields? Otherwise, it may be worthwhile to think about registering a custom entry card as you mention. |
@erezrokah do you have documentation, or an example of what you're looking for? This is what I was following when I submitted the PR: https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md Not a lot there, and "other methods of extending the CMS" is pretty broad. I found this reference to registerEntryCard, but it hasn't been merged, so it's likely not a good example to follow. Looks like several people have taken a crack at this feature, in fact, but none has been merged. The registerEntryCard implementation is perhaps more elegant, but it's also far more invasive to the codebase and more difficult to use—both of which factors (absent a clear style guide) I assume would make the PR less likely to be approved and not more. And I'm finding plenty of examples in the commit history where minimal changes to existing modules are accepted, very similar to what I've submitted. So I'm left to guess, and well, "ain't nobody got time for that". ;) Seems like you all have a specific idea of how you want this feature implemented, so the community should just leave it alone, and let you get to it when you get to it. Your show. Your rules. It's cool. |
@austincondiff that's a very nice improvement. God speed. :) On the face of it, it doesn't seem to accommodate custom cards per collection type, but the default columned rows are a significant step up, and are something I'd live with. It's a great product, team—thanks for your work. |
@MilesRomney I appreciate the feedback and we should do better in terms of making it clear on how to contribute. You are more than welcome to suggest topics here. I was waiting for some more feedback in order to schedule office hours, but I might just decide on a time and share a zoom link. I couldn't find a PR with the Previous work on customizing the entry cards was merged in here via the I think this boils down to 2 big features:
And 1 smaller feature of replacing the entry card component which is the relevant discussion for this issue. This can actually pave the way for the customization feature. From now on, let try and keep the discussion specific to the issue at hand and have contribution related comments here. |
@erezrokah @MilesRomney work is being done by @fpunny to implement the design in #2557. If any additions need to be made, please speak up in #3265. |
Thanks... this is going to be a big help for me until #3265 gets merged in somewhere down the line. I have use cases wherein we're using entries like calendar events and recurring events just look like this in the Collections Entry UI: It would, at the very least, do a world of good to show wherein the dates provided are not created dates, but rather dates input by users: |
This should be available via the You can reference entry fields, e.g. |
@erezrokah thanks for the tip! I found it in docs just after I posted. I guess I haven't looked into solving this problem in a year and was considering it again while contemplating a new project. Didn't realize it had been addressed since then and I didn't see it at first in docs. This is really going to help us out! Looking forward to more UX changes as seen in the Invision prototype in #3265 For future reference, anyone know a straightforward way of searching keywords against releases in a repo? |
I think
|
Hi @d4rekanguok, there is a fork with
|
I would love to see this coming alive. a similar approach could also work for the summary of list widget items.
|
Is there any solution yet for customizing the collection list cards? |
Summary
Given the flexibility of the collection system, it's highly incongruous to strictly limit the visible summary on list and grid cards to a single line of un-formatted text. At some point, this may warrant a customization system parallel to what's now available for previews, where modules are created for each collection type that define their list and grid cards—that would be a best-case scenario.
In the meantime, the same result can be achieved by simply allowing the configured collection summary (what in the EntryCard.js is assigned to the "title" constant) to include HTML tags. That, paired with currently-permitted CSS overriding, would give developers a lot of freedom in designing list and grid cards.
This can be achieved simply by rendering EntryCard titles using dangerouslySetInnerHTML. Then, cards could easily be configured on a collection-specific basis.
Example
In config.yml, consider a collection with the following summary:
... with this CSS added to static/admin/cms.css:
This would result in an EntryCard that looks like this:
I've prepared a branch in my fork with this change: MilesRomney@0c6a719
The text was updated successfully, but these errors were encountered: