zopyx
(Andreas Jung)
December 1, 2017, 2:05pm
1
This browser page
<browser:page
for="..."
class="..."
permission="..."
name="as-tile"
template="tile.pt"/>
tile.pt:
<div class="tile">....</div>
is supposed to return some HTML fragment.
Plone/Zope however inserts a HTML around a fragment and Plone injects script tag for protect.js.
Is there a way to avoid this? I want the pure HTML fragment.
-aj
espenmn
(Espen)
December 1, 2017, 3:08pm
2
Not related to the question, but should you be using 'tile' ?
<plone:tile
name="…"
title="…"
for="…"
schema=".tiles.IMyTile"
class=".tiles.MultiTile"
template="templates/my-tile.pt"
davisagli
(David Glick)
December 1, 2017, 3:10pm
3
Ugh, it looks like there's no good way to prevent this for particular text/html responses. auto.py in plone.protect is the place to add a way.
zopyx
(Andreas Jung)
December 1, 2017, 3:31pm
4
Again, completely unrelated.
-aj
zopyx
(Andreas Jung)
December 1, 2017, 3:46pm
5
True.
The workaround is to write a helper browser view that traverses into the original view and returns the HTML snippet directly.
-aj
jaroel
(Roel Bruggink)
December 1, 2017, 4:22pm
6
I think you can add a ITransform for (IMyTile, *) and skip the transform all together.
Something like https://github.com/plone/plone.tiles/commit/fba7783024d6aa50dae5945b59d400716968432a
Not beautiful, but should work.
zopyx
(Andreas Jung)
December 1, 2017, 4:36pm
7
Thanks but this is completely over the top