eea / eea.facetednavigation

Faceted Navigation for Plone Classic
http://eea.github.com/docs/eea.facetednavigation
20 stars 56 forks source link

Use of deprecated 'main' macro slots and HTML template code for JSON delivery #15

Closed TobiasWeigel closed 9 years ago

TobiasWeigel commented 12 years ago

Hi,

we are having trouble setting up eea.facetednavigation on a Plone 4.1.3 site with a custom Diazo theme. With the sunburst theme, everything works fine. With our custom theme and Diazo enabled, we get the following problems:

Solution:

Going through the eea.faceetdnavigation code, I've found the following workarounds which fix all problems (as far as I can tell):

  1. the 'faceted criteria' page uses an old "main" macro slot instead of the preferred "content-core" - so replace the slot name in browser/template/configure.pt.
  2. browser/template/configure.pt also uses the old "main" slot. In fact, I don't really get the idea why there is an HTML template for delivering JSON code - firebug shows me that with Diazo and our theme enabled, the JSON code is wrapped with HTML tags, so jquery will barf and this causes the 'portal type' widget to freeze up. My solution was to simply remove all code from this template, then it worked.
  3. same as 2., there is another identical file at widgets/tagscloud/counter.pt

Best, Tobias

avoinea commented 12 years ago

Hi Tobias,

Do you have a pull request for this that doesn't break eea.facetednavigation (with Sunburst, Plone 4.0-latest, Plone 4.1-latest and Plone 4.2-latest) ?

For the second point, I don't get it? Did you mean browser/template/counter.pt? It can be a cache issue, I don't remember but I can see in counter.py a comment like:

Calling self.index() will set cache headers for varnish

Cheers, Alin

TobiasWeigel commented 12 years ago

Hi Alin,

i've just updated our production instance with the fork I made and it seems to work. I cannot guarantee that it works on anything else than Plone 4.1.5, but would be quite confident.

The second point, yes I meant the counter.pt template, sorry for the confusion. I do not think it is a caching issue since according to the HTTP headers the JSON data gets delivered by zope and my developer instance does not include a varnish instance (our production server does). Feel free to drop the commit if you think my solution is nonsense :) It might well be that our theme product is the main issue here, some missing exceptions in our rules file, but currently I don't have time to investigate this further. I still don't quite understand why there is a HTML template for JSON code (this should never have worked?!), but maybe I'm missing something.

Best, Tobias

afrepues commented 11 years ago

This issue seems have been fixed in commits 385424ac10 and 080ddfda2f, can either of you check and close it if this is the case?