Multilingual Catalog Indexes for Plone
Project description
Indexes optimized to query multilingual content made with plone.app.multilingual.
Features
- tgpath Index (Translation Group Path)
Utility and index to get the path of an item as UUIDs of its translationgroup.
- language_or_fallback Index
Index to query items and get one fallback if not available in the current language. Fallbacks can be configured in control-panel and are stored in the registry.
- Integration with Collections
Both indexes are available in Collections and other places using plone.app.querystring under the hood. Both indexes do only need activation.
tgpath is available as a switch Language independent location. If this is selected, the normal path will be converted to a tgpath! If no path is selected this switch has no effect.
language_or_fallback is available as Fallback languages. If a path is selected together with this option, the path will be converted to a tgpath.
If the tgpath or language_or_fallback is used in a Collection, the path will be set to the portal. Thus the usal automatically added fixation to the current INavigationRoot wont be set, because language root folders are navigation roots.
Behind the scenes
- Fallback Index
It is in fact a simple FieldIndex. Fallback detection happens on index time. On query time it has the same functionality and performance as the normal Language index.
- Translation Group Index
It is in fact a normal ExtendendPathIndex. Just the path it indexes consists out of the translation group uids. If an item is not translatable and thus is not part of an translationgroup, then its normal id is taken as patyh element. Path example: /Plone/f5843e426b5d47cdb44af587b322f7ea/320b1ffbf0f64603803043d48bd57516.
In order to query the index, you need to use the translationgroup path instead of the id path:
from plone.app.multilingualindexes.tgpath import tg_path import plone.api plone.api.content.find( tgpath='/'.join(tg_path(context)), language_or_fallback=plone.api.portal.get_current_language() )
Installation
Install plone.app.multilingualindexes by adding it to your buildout:
[buildout] ... eggs = plone.app.multilingualindexes
and then running bin/buildout
Contribute
Issue Tracker: https://github.com/plone/plone.app.multilingualindexes/issues
Source Code: https://github.com/plone/plone.app.multilingualindexes
License
The project is licensed under the GPLv2.
Contributors
Jens W. Klein, jk@kleinundpartner.at
Peter Holzer, peter.holzer@agitator.com
Patrick Gerken, gerken@patrick-gerken.de
Changelog
2.0 (2019-07-12)
Patch CMFCore because of https://github.com/zopefoundation/Products.CMFCore/issues/79 [jensens]
Fix bugs on rename/move/delete (wrong fallbacks) [jensens]
Drop support of Plone 5.1 [jensens]
Python 3 compatibility [jensens]
Refactor index to be less complex on indexing. [jensens]
Bugfix: Use latest plone.app.multilingual and add subscribers to ensure in-/rein-/unindexing. [jensens]
Fixing “RuntimeError: the bucket being iterated changed size” (issue #3) [gogobd]
Depend on Products.CMFPlone instead of Plone to not fetch unnecessary dependencies. [thet]
1.0 (2016-10-15)
Initial release. [jensens]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for plone.app.multilingualindexes-2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d00007a38cc3412056a605a8cad2dc78dfaf33c0497804fce6f0f42ce91e7e0 |
|
MD5 | 1cf7bcce59dfa4cbe97f0297dc47a792 |
|
BLAKE2b-256 | 70156e35ab2f9f69386a0fe94c91d71a0a432f467c3c4089287632ad82ef47b5 |
Hashes for plone.app.multilingualindexes-2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d45e475073c4176a86bd7673b8af30ddbcd23e775e1b5dfb77092cb4e5f22c85 |
|
MD5 | 83c4e485bc883f28f09779161f536536 |
|
BLAKE2b-256 | b760f7a30505dea6dbc0f74d4627d4112f4a925a6c1a76ec12ac219bf0006322 |