BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
how to use manipulations in fluid fields?
#98 opened by Büro Ballmann Weber
Description
hi buzzingpixel,
how can I use manipulations in a fluid-field setup? I tried to place the needed " manipulations="true" " everywhere but I can’t get the system to use manipulations. it only works with the normal img tag {img:url}.
this is my current code:
{exp:channel:entries channel="exhibitions" show_future_entries="yes" show_expired="yes" dynamic="yes" limit="1"}
<article>
{text_und_foto}
{text_und_foto:text}
{content}
{/text_und_foto:text}
{text_und_foto:abbildungen_ansel manipulations="true"}
{content}
<img src="{img:small:url}" width="{img:small:width}" height="{img:small:height}">
{/content}
{/text_und_foto:abbildungen_ansel}
{/text_und_foto}
</article>
{/exp:channel:entries}
thank you and kind regards, matthias
Replies
- TJ Draper
Replied 3/21/2018 1:23 PM, Edited 3/21/2018 5:47 PM
The manipulations you are trying to use are applied to the Save Directory in the EE file manager settings (i.e., not the Upload Directory)?
- Büro Ballmann Weber
Replied 3/21/2018 1:28 PM, Edited 3/21/2018 5:47 PM
yes, I just checked.
- Büro Ballmann Weber
Replied 3/21/2018 1:31 PM, Edited 3/21/2018 5:47 PM
I also resynced all the files to be sure the manipulations were made. the generated code does not render the url/height/width. instead it stays…
<img src="{img:small:url}" width="{img:small:width}" height="{img:small:height}">
- Büro Ballmann Weber
Replied 3/21/2018 1:33 PM, Edited 3/21/2018 5:47 PM
oh, I ment, the line of code (starting with <img) stays exactly the same in the rendered browser code.
- TJ Draper
Replied 3/21/2018 1:33 PM, Edited 3/21/2018 5:47 PM
Actually, I think
manipulations="true"
may need to be on the{content}
tag since that's technically the tag pair that's being replaced by the Ansel methods. - Büro Ballmann Weber
Replied 3/21/2018 5:37 PM, Edited 3/21/2018 5:47 PM
ha. ok, I found the error.
you’re right: the tag has to be used on the {content} tag.
I tried that prior to setting up this ticket but saw no result… as it happened now, a few minutes ago. but when I looked into the source code of the browser, I saw that the link to the image was rendered correctly.
so the picture was there, but it wasn't displayed. why?
as manipulation i specified 600px width and no height, which was automatically replaced with 0. and since i tagged the width and height in the template with the corresponding tags...
width="{img:small:width}" height="{img:small:height}"
The picture wasn't shown until I....
img { height: auto; }
in the css-styles, it was to be seen.
We actually use Ansel on all websites, and of course there are many different image sizes, but I have never noticed that an image will be output with height 0 if only an image width is entered.
Is that right or is it a bug?
thank you very much for your quick help! kindest regards, matthias
- TJ Draper
Replied 3/21/2018 5:40 PM, Edited 3/21/2018 5:47 PM
The image manipulations on the save directory are native to EE. I'm just getting the values and making them available to the Ansel image tags.
- Büro Ballmann Weber
Replied 3/21/2018 5:47 PM
Oh, I'm sorry – I wasn't clear. I know the sizes come directly from EE, so I was wondering if this could be a bug in EE. I will go through our other projects tomorrow and take a look if this behaviour is the same in the other ee-version we’ve used.
Maybe I just haven't noticed it yet or there were always CSS styles that overridden it.