-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Add options to override listing blocks "no results". Add a default noResultsComponents, and another for the imageGallery variation #3602
Conversation
✅ Deploy Preview for volto ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Passing run #4094 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
IMHO to include a component in the variation to show the No results component does not work. It difficults reusing variations. Say I want to prepare a variation to use it both in News listing and Event listings, and in one I want to put "no future events" and in the other "there are no news". Using a single component to add this message would mean to add a new variation just to change the "No results". My 2 cents. |
… into listing-no-results-component
I've added some data to the NoResults component, so now we can enhance the schema for the variation and use the values in the NoResults component. For @erral example:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems ok to me, but shouldn't this is a good use case for the component registry? Even for the variations.
config.registerComponent({
name: 'NoResults',
component: NoResultsComponentForVariation1,
dependencies: ['Listing', 'Variation1'],
});
What do you think? Anyways is fine as it is for me, just wanted to pull out use cases for the component registry.
It makes sense, do you have any example in other component to see how to do it? @sneridagh |
Not yet a lot of examples but: volto/src/components/theme/PreviewImage/PreviewImage.jsx Lines 15 to 20 in 846b095
We are using it a lot lately: Select which teaser template you should use based on the content type:
and the registration:
hope this helps! |
so, shoud I register the component using registerComponent function or just writing down here: https://github.com/plone/volto/blob/master/src/config/Components.jsx |
@ionlizarazu better the register component... think of it as the API to do the registrations. Like ZCA. ;) Could be that to avoid confusion we change the registration of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get this approved, we'll need some documentation
I have added documentation on how to use this feature |
@sneridagh let's merge this, it makes sense to have it |
@ksuess and what about adding an option in the schema to hide the heading or the listing when there are no results? That's easier from the CMS user perspective: just hide the title and it's done. No need to add CSS code to achieve it. |
My request that I have to solve is: "Hide a listing if there is no result". |
I see 😅 |
@sneridagh then we can merge this one and then @ksuess' PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment
docs/source/blocks/index.md
Outdated
"property=og:description": "Volto features the Pastanaga Editor Engine, allowing you to visually compose a page using blocks." | ||
"property=og:title": "Blocks" | ||
"keywords": "Volto, Plone, frontend, React, blocks" | ||
'description': 'Volto features the Pastanaga Editor Engine, allowing you to visually compose a page using blocks.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erral @ksuess @stevepiercy uh I realised we are using different types of quotes here, also in next one...
Is there any accepted styling for md meta?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double quotes "
is what is created initially by a Python script, and can be copy-pasted from other .md files. This is consistent with Black and other Python style guides for Plone. If single quotes are being used, we need to change them.
Also I should review this documentation before merge. Please give me until tonight to do that. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really good stuff!
I have only a few minor changes: primarily, revert a few changes in CHANGELOG.md, and use one sentence per line.
Also be aware of your editor's defaults. If you see a lot of changes for a file that you did not deliberately edit, then you need to adapt your editor to this repo's defaults. Thank you!
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Thanks @stevepiercy for the review. I have reverted all those quotation changes. I really don't know why my editor does this kind of stuff... I am wondering if our .estlintrc configuration may have some influence on that... I will check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one typo, then the docs are good. Thank you!
Co-authored-by: Katja Süss <k.suess@rohberg.ch>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
…ResultsComponents, and another for the imageGallery variation (#3602) Co-authored-by: Mikel Larreategi <mlarreategi@codesyntax.com> Co-authored-by: Tiberiu Ichim <tiberiuichim@users.noreply.github.com> Co-authored-by: Steve Piercy <web@stevepiercy.com> Co-authored-by: Víctor Fernández de Alba <sneridagh@gmail.com> Co-authored-by: Katja Süss <k.suess@rohberg.ch>
* master: (23 commits) Teaser block in core (#3706) Release 16.13.0 (#4457) Release generate-volto 6.2.5 Amend inconsistencies in generator package after release :/ Use latest plone/server breed images (#4454) Export App and its connectorAppComponent as standalone (#4413) Release generate-volto 6.2.4 Fix generator adding the jest config for @plone/volto-slate (#4453) Amend Towncrier news item (2) Amend Towncrier news item Add towncrier checker (#4450) Release 16.12.0 (#4445) Update link to Yarn 3 Workspaces to avoid redirect to Yarn Classic 1.x. (#4444) Remove link to yarnclasic Add options to override listing blocks "no results". Add a default noResultsComponents, and another for the imageGallery variation (#3602) Tidy up backend/index.md (#4431) On error pages, don't switch to default site language (#4425) Provide disable props to all widget and pass disable props in babel view (#4398) fix : Restrictive propTypes for widgets (#4354) Change the width of overlay (#4372) ...
…ResultsComponents, and another for the imageGallery variation (#3602) Co-authored-by: Mikel Larreategi <mlarreategi@codesyntax.com> Co-authored-by: Tiberiu Ichim <tiberiuichim@users.noreply.github.com> Co-authored-by: Steve Piercy <web@stevepiercy.com> Co-authored-by: Víctor Fernández de Alba <sneridagh@gmail.com> Co-authored-by: Katja Süss <k.suess@rohberg.ch>
resolves Change the "no results found" message of ListingBlock to something customizable #3552