Open volkerjaenisch opened 9 years ago
May I know how to use this file? @volkerjaenisch
Just install collective.plonetruegallery . Then replace the collection.py file that lives in this package with the code shown above.
@volkerjaenisch
Thanks for your reply, I am very new to this...
Do you mean after replay the file then I can use the gallery view in plone 5 collection?
Yes. We are using PTG with collections in Plone 5. You only need to replace this one file. If you get into problems feel free to ask.
@volkerjaenisch I have follow the step you mentioned, buy the PTG gallery view still not show up in the selection list of my collections... any idea?
The alternative is to use my fork of PTG: https://github.com/volkerjaenisch/collective.plonetruegallery
@volkerjaenisch thanks for your help
I try your method and now with collective.plonetruegallery 3.4.7.dev0 but there is no gallery view in the collection ... do i missed something my plone is Plone 5.0.6rc1 (5016) do I need to active "Archetypes Content Types for Plone" ?
@volkerjaenisch and my plone.app.collection = 1.1.6 is that same as yours
The Version number 1.1.6 should not be an issue. Please check the configuration for collections:
Tested with plone.app.collection = 1.1.6, works flawlessly.
@volkerjaenisch
Thanks Gallery view now show up in the collector and can be select but it got a error as below.
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module collective.plonetruegallery.browser.views.galleryview, line 29, in call
Module Products.Five.browser.pagetemplatefile, line 125, in call
Module Products.Five.browser.pagetemplatefile, line 59, in call
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in call
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module d0e9d24677fac041b6f34863811f414d.py, line 459, in render
Module e3bbe0aa01b667bbf022121054b66185.py, line 1223, in render_master
Module e3bbe0aa01b667bbf022121054b66185.py, line 420, in render_content
Module d0e9d24677fac041b6f34863811f414d.py, line 447, in __fill_content_core
Module d0e9d24677fac041b6f34863811f414d.py, line 95, in render_content_core
Module collective.plonetruegallery.galleryadapters.base, line 100, in number_of_images
Module plone.memoize.instance, line 51, in memogetter
Module collective.plonetruegallery.galleryadapters.basic, line 155, in cooked_images
Module collective.plonetruegallery.galleryadapters.basic, line 142, in retrieve_images
Module zope.component._api, line 109, in getMultiAdapter
ComponentLookupError: ((<Collection at /test/test>, <collective.plonetruegallery.galleryadapters.basic.BasicAdapter object at 0x7f775d31b1d0>),
Are you sure that you have only images (Type Image) and No PDF-Files etc. in the collection? Have you any Images in the collection?
Yes, 1 jpg can show with Album view.
Can you please make sure that the alternative collectiv.plonetruegallery is really used:
<your plone url>/prefs_install_products_form
Ok here is the result,
I don't know why it error and not build
sudo -u plone_buildout bin/buildout Develop: '/opt/plone/zinstance/src/collective.plonetruegallery' warning: no files found matching '.rst' warning: no previously-included files found matching '.coveragerc' warning: no previously-included files found matching 'buildout.cfg' warning: no previously-included files found matching 'tox.ini' warning: no previously-included files found matching 'travis.cfg' warning: no previously-included files matching '.pyc' found anywhere in distribution Uninstalling precompiler. Uninstalling zopepy. Uninstalling instance.
You have to enter the virtual environment first.
in zeoserver dir:
source bin/activate
./bin/buildout
If this fails please post the complete output
@volkerjaenisch
It is working now, thanks alot.
you are welcome
I noticed some problems with dexterity collections from plone.app.contenttypes in Plone4.3 and Plone5. Namely they do not work anymore. There are four problems: 1) The collections adapter is bound to plone.app.collections.interfaces.ICollection but dexterity collections have plone.app.contenttypes.interfaces.ICollection as marker interface. So the adapter does not fit the interface. 2) In dexterity the collections do no longer expose the getRawQuery function. See https://community.plone.org/t/where-is-defined-collection-getrawquery-and-how/1040 . This leads to a stack trace. 3) If this problem is overcome the wrong image type is used in the query. 4) And last but not least. The current code does not work with collections collecting subgalleries.
I wrote a replacement to collection.py that fixes most of the problems but does not address all the corner cases. The code is ugly and obtains a monkey patch to change the get_subgalleries function of the basic_adapter. But it may be clear enough to show my intentions. Also the code will not work with ATCollections - which is not a problem because this new adapter can be bound to the dexterity specific plone.app.contenttypes.interfaces.ICollection and live in friendly coexistence with the old adapter for ATCollections.