Re: Dexterity - TAL Expression to Display Images from Blobstorage
espen <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.user |
|---|---|
| Message-ID | <[email protected]> |
Hi
I think you need to use another syntax for a dexterity image field: Try this:
<img src="" alt=""
tal:condition="context/image|nothing"
tal:define="scales context/@@images;
scale python:scales.scale('image', 'mini')"
tal:replace="structure python:scale and scale.tag(css_class='myImage') or None" />
Where ‘image’ is the name of your image field (if your field has another name, it would be something like:
scale python:scales.scale(‘my_image', 'mini')"
Espen
6. des. 2014 kl. 12:49 skrev andreasma [via Plone] <ml-node+s293351n7572982h95-PKuAHvtXa09l57MIdRCFDg@public.gmane.org>:
> Hi Asko,
>
> edited the wrong view-template. Now with the correct one.
>
> Am 06.12.2014 um 11:51 schrieb Andreas Mantke:
>
> > Hi Asko,
> >
> > Am 06.12.2014 um 11:24 schrieb Asko Soukka:
> >> Hi Andreas,
> >>
> >> have tried the following methods (included in Plone by default):
> >>
> >> https://pypi.python.org/pypi/plone.app.imaging
> >>
> >> e.g.
> >>
> >> img tal:replace="structure context/@@images/image/mini" />
> >>
> >> where 'image' is the fieldname.
> >>
> But that doesn't works either.
>
> Traceback:
>
> Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
> Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
> Module zope.tales.tales, line 696, in evaluate
> - URL: /home/andi/Plone/libotemplatecenter/src/tdf.extensionsuploadcenter/src/tdf/extensionsuploadcenter/eupproject_templates/view.pt
> - Line 42, Column 8
> - Expression: <PathExpr standard:u'context/@@images/project_logo/mini'>
> - Names:
> {'args': (),
> 'container': <Container at /softwarecentertest/en/extensions/bundesgit-for-libreoffice>,
> 'context': <Container at /softwarecentertest/en/extensions/bundesgit-for-libreoffice>,
> 'default': <object object at 0x7f94611ba500>,
> 'here': <Container at /softwarecentertest/en/extensions/bundesgit-for-libreoffice>,
> 'loop': {},
> 'nothing': None,
> 'options': {},
> 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f944c9350a8>,
> 'request': <HTTPRequest, URL=http://localhost:9095/softwarecentertest/en/extensions/bundesgit-for-libreoffice/view>,
> 'root': <Application at >,
> 'static': <Products.Five.metaclass.DirectoryResource28 object at 0x7f94446730d0>,
> 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x996d210>,
> 'traverse_subpath': [],
> 'user': <PropertiedUser 'admin'>,
> 'view': <tdf.extensionsuploadcenter.eupproject.View object at 0x7f9444673190>,
> 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f9444657a10>}
> Module zope.tales.expressions, line 217, in __call__
> Module Products.PageTemplates.Expressions, line 147, in _eval
> Module zope.tales.expressions, line 124, in _eval
> Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
> Module zope.traversing.adapters, line 136, in traversePathElement
> - __traceback_info__: (<plone.namedfile.scaling.ImmutableTraverser object at 0x7f9444668190>, 'mini')
> Module plone.namedfile.scaling, line 126, in traverse
> LocationError: 'mini'
>
>
> --- end of Traceback ---------------
>
>
> Seemed there is an issue with the image scaling product? I could see image handling inside the configuration page and there is also an entry for mini. I tried also with no success the 'icon' tag.
>
> Kind regards,
>
> Andreas
>
> --
> ## Developer LibreOffice
> ## Freie Office-Suite für Linux, Mac, Windows
> ## http://LibreOffice.org
> ## Support the Document Foundation (http://documentfoundation.org)
> ## Meine Seite: http://www.amantke.de
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Plone-Users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://plone.293351.n2.nabble.com/Dexterity-TAL-Expression-to-Display-Images-from-Blobstorage-tp7572979p7572982.html
> To start a new topic under General Questions, email ml-node+s293351n293352h65-PKuAHvtXa09l57MIdRCFDg@public.gmane.org
> To unsubscribe from Plone, click here.
> NAML
--
View this message in context: http://plone.293351.n2.nabble.com/Dexterity-TAL-Expression-to-Display-Images-from-Blobstorage-tp7572979p7572995.html
Sent from the General Questions mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users