Skip to content
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

PoC custom ItemBodyTemplate #86

Merged
merged 4 commits into from
Jun 7, 2023
Merged

PoC custom ItemBodyTemplate #86

merged 4 commits into from
Jun 7, 2023

Conversation

danalvrz
Copy link
Contributor

@danalvrz danalvrz commented Jun 5, 2023

No description provided.

@danalvrz danalvrz requested a review from davisagli June 5, 2023 23:32
@sneridagh
Copy link
Member

@danalvrz looks good!

Can you please use the pattern used in #88 ? So the customization points to a component in the package?

@sneridagh
Copy link
Member

@danalvrz wait for me to merge #88 and #87

@danalvrz danalvrz marked this pull request as ready for review June 6, 2023 17:20
@sneridagh sneridagh merged commit b5f572b into main Jun 7, 2023
@sneridagh sneridagh deleted the poc-item-boby-template branch June 7, 2023 09:27
{items.map((item) => {
const hasType = item['@type'];
const CustomItemBodyTemplate = config.getComponent({
name: 'ListingItemTemplate',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sneridagh @danalvrz Sorry I'm a bit late with my feedback. There are 2 changes I would submit for consideration:

  1. I would call this component SummaryListingItemTemplate to make it clearer in the name that it is specifically for the summary variation and not other listing variations. (This one is not used for the default variation, nor the grid...)

  2. It would be nice if we could register a default version of this template that is used if no component was registered for the specific content type. Then the default could be adjusted by shadowing just that template, rather than this one. But, I think this requires adding support for falling back to a default in the volto registry, and it might be too big a thing to consider.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the name as suggested in 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants