Package: collective.eeafaceted.collectionwidget
collective.eeafaceted.collectionwidgetPackage adding a widget for eea.facetednavigation that list collections as base searchesSource code @ GitHubContinuous Integration @ Travis-CIHow it worksOnce installed, a new widgetCollection Linkis available while configuring the faceted navigation.
If you add Collections to a folder on which faceted navigation is enabled, the widget will display
the found Collections and use it as base searches.
A special content DashboardCollection is also provided, it is based on the Collection but use additional
behaviors :The ‘DashboardCollection’ behavior that provides an extra field showNumberOfItems, making it possible to display the counter on a per DashboardCollection basis;The ‘TAL condition’ behavior that adds a field into which defining a TAL expression that will make it possible to hide or show a Collection in the widget.InstallationTo installcollective.eeafaceted.collectionwidgetyou simply addcollective.eeafaceted.collectionwidgetto the list of eggs in your buildout, use make run to launch buildout and start Plone.
Then, installcollective.eeafaceted.collectionwidgetusing the Add-ons control panel.ConfigurationAll that is necessary when adding this kind of widget in a faceted navigation is to enter a name for the displayed widget and to select the vocabularycollective.eeafaceted.collectionwidget.collectionvocabulary.  It will automatically display the Collections contained in the folder the faceted navigation is configured on.  It is also possible to group Collections by category, to do so, instead of adding the Collections directly in the folder, you can create a subfolder that will contain the Collections.eea.facetednavigation versionFrom version 1.0, the widget requires at leasteea.facetednavigation10.0 where widget is built usingz3c.form.
If you are usingeea.facetednavigation< 10.0, you need to use a version ofcollective.eeafaceted.collectionwidget< 1.0.Changelog1.16 (2023-07-27)Use default value if available and if there is no parameter in request
[mpeeters]Fix for Python 3 compatibilty
[mpeeters]1.15 (2023-07-03)Ensure that parent can be displayed ifhide_categoryis True and without category
[mpeeters]Addhide_categoryoption (False by default) to add the possibility to hide category titles
[mpeeters]1.14 (2022-01-10)Fixedutils.getCurrentCollection, whencollectionUIDretrieved fromfacetedQueryform value, we have a list of values.
[gbastien]1.13 (2022-01-03)Use an alias for__call__methods that useram.cacheinvocabulary.pythis way, the key generated for theram.cachestorage is different.
[gbastien]1.12 (2021-12-06)Addedram.cacheforCollectionCategoryVocabularyto avoid query at each
request as query is using asort_on=getObjPositionInParentwhich is very slow.
[gbastien]OverrideDashboardCollectionquery computation that by default inplone.app.contenttypesandplone.app.querystringwill arbitrary add apathindex in the query, and again, thepathindex is very slow and just not necessary.
[gbastien]Use unrestricted catalog query when possible.
[gbastien]Optimized the catalog query that compute thenumber_of_itemscounters.
[gbastien]1.11 (2020-05-28)Addedreal_contextparameter toCollectionVocabulary.
[sgeulette]UseITALConditionbehavior to evaluate thetal_conditionexpression soITALCondition.complete_extra_expr_ctxis taken into account.
[gbastien]1.10 (2019-09-12)Invalidatecollective.eeafaceted.collectionwidget.cachedcollectionvocabularyifportal_urlchanged, this can be the case when application is accessed
by same user from different URi.
[gbastien]1.9 (2019-08-23)Added parameterraise_on_error=Truetoutils._get_criterionso it will
returnNonein case passed context is not a faceted context instead
raising an error.
[gbastien]1.8 (2019-08-13)Do not store the collection object interm.valueof vocabularyCollectionVocabularybecause it can be ram cached
(inCachedCollectionVocabularyfor example) and ram caching methods
returning objects is a bad idea.
[gbastien]Addedcaching=Trueparameter toutils.getCurrentCollectionso it is
computed one time by request for a givenfaceted_context.
[gbastien]1.7 (2019-03-28)Added parameter RenderTermView.compute_count_on_init, True by default that
will do the collections count be computed when the widget is rendered. This
makes it possible to disable it.
[gbastien]Fix an issue with the widget used in combination with collective.solr
[mpeeters]Inutils._updateDefaultCollectionForuseICriteria.editto change value
as it handles persistence instead doing it ourselves.
After value is changed, triggerFacetedGlobalSettingsChangedEvent.
[gbastien]1.6 (2019-01-03)Avoid error when deleting site.
[sgeulette]Factorized code called inwidget.__call__inwidget._initialize_widgetmethod so it is easy to call from outside.
[gbastien]1.5 (2018-12-18)Temporary fix to not crash inKeptCriteriaadapter when managing daterange
widget.  For now, if index is aDateIndexand values is alist,
we do not keep criteria for it.
[gbastien]1.4 (2018-11-29)Migrate IFacetedNavigable criterias, replacing old vocabulary bycachedcollectionvocabulary.
[sgeulette]Added methodRenderCategoryView._get_category_templateto formalize how to
get template used to display a term category.
[gbastien]1.3 (2018-11-20)Removed AT Collection creation from tests as it is not used and it fails
because of a bug in plone.api==1.8.4.
Seehttps://github.com/plone/plone.api/pull/414[gbastien]Define acsscompilationname for collection widget own CSS ressource.
Do redefine as little as possible when including widget view/edit css/js into
eea.facetednavigation existing bundles.
[gbastien]Moved CachedCollectionVocabulary from imio.dashboard, now namedcollective.eeafaceted.collectionwidget.cachedcollectionvocabulary.
Moved dashboard collection related events.
[sgeulette]1.2 (2018-09-04)Added translations forEnabled?.
[gbastien]1.1 (2018-06-22)Corrected bad release, include last code.
[gbastien]1.0 (2018-06-20)Make widget compatible witheea.facetednavigation >= 10.0.
This makes it no more compatible with older version.
[gbastien]Make package installable on both Plone4 and Plone5.
[gbastien]Rely onplone.app.contenttypesinsteadplone.app.collection.
[gbastien]Do not break to display the facetednavigation_view if no collection widget
defined, it is the case when just enabling the faceted navigation on a new
folder.
[gbastien]Added fieldenabled(default=True) on a DashboardCollection make it possible
to disable it so it is no more displayed in the collection widget (portlet).
We specifically do not use a workflow for DashboardCollection.
[gbastien]0.9 (2018-05-25)Moved here some methods from imio.dashboard:
_get_criterion, getCollectionLinkCriterion, getCurrentCollection
[sgeulette]facetednavigation_view override to manage default collection widget redirection
[sgeulette]Added portal attribute on category view.
[sgeulette]0.8 (2018-05-03)Fix wrong release version 0.7.
[gbastien]0.7 (2018-05-03)Removed useless parameterqueryfromCollectionVocabulary.__call__.
[gbastien]Usezope.globalrequest.getRequestand notcontext.REQUESTto get the REQUEST.
[gbastien]0.6 (2016-12-07)Add an option force_redirect_to in CollectionVocabulary to force generating
no_redirect=1 urls for all collections.
[vincentfretin]Don’t modify the title of the page if the h1 has class dontupdate.
[vincentfretin]Fix bug with DateTime in kept_criteria_as_json.
[cedricmessiant]0.5 (2016-05-13)Added plone.app.collection as a real dependency, this way it is present
and we make sure that the profile is installed.
[gbastien]0.4 (2016-03-29)Adapted tests for eea.facetednavigation 8.8, moved to the collective,
prepare for release on pypi.python.org.
[gbastien]0.3 (2016-03-03)Display number of collection items in the term view. Override
display_number_of_items method if you want to alter this behaviour.
[cedricmessiant]0.2 (2015-09-03)The context for @@render_collection_widget_category is now the category
(folder) and the context for @@render_collection_widget_term is the
collection. (closes #11677)
[vincentfretin]When generating link to sub faceted, make sure every default values are
correctly initialized, especially value of the Collection widget for which
the id could be different than current faceted Collection widget id
[gbastien]If we use functionnality of sub folders where faceted navigation is enabled,
and the default collection is on one of these subfolders, do not redirect to
this default collection if we use the ‘folder_contents’ of the root folder or
user is systematically redirected to the subfolder and it is not possible
anymore to access on the root folder
[gbastien]Added portal_url attribute in RenderCategoryView
[sgeulette]0.1 (2015-07-14)Initial release.
[IMIO]