my code
{exp:weblog:entries weblog="{wb}" order_by="date" sort="asc" limit="1" disable="member_data|trackbacks|pagination|category_fields"}
<div class="flickr">
<a href="#" title="отвори колекцията от снимки">{exp:imgsizer:size src="{imgFiles}" width="85" height="57" alt="отвори колекцията от снимки"}</a>
<pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>
<pre><code> </div>
{/exp:weblog:entries}</code></pre>
it outputs all the urls + total result number
Exactly the problem I mentioned - you’re using the single variable/tag then the pair.
Do this instead:
<a href="#" title="отвори колекцията от снимки">{exp:imgsizer:size src="{imgFiles}{file_url}{/imgFiles}" width="85" height="57" alt="отвори колекцията от снимки"}</a>
<pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>
<p>
Note the change in the imgsizer parameters.
works but this returns all uploaded images and the total number the point is that this fragment of code tries to be like thumb of an album from gallery - so it needs to display only one image (first one in case file field returns first with i single tag) and the number os images, which are uploaded
Third try lucky…
<a href="#" title="отвори колекцията от снимки">{imgFiles}{if count == 1}{exp:imgsizer:size src="{file_url}" width="85" height="57" alt="отвори колекцията от снимки"}{/if}{/imgFiles}</a>
<pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>
<p>
Thanks Ryan- I actually took a stab at it and put it at line 293 above the return.
For Mark Huot’s File v. 3.1.1 extension, could someone please show exactly where to insert the line of code? I tried it at 293 as this post suggests, and also at line 550 as another post suggests, and nothing’s working (errors loading the CP page for weblog entries using the File type field).
Also, is it necessary to set the field to some type other than File and then set it back as suggested here under “One More Thing”? http://devot-ee.com/articles/item/fix-it-yourself-extensions-or-field-formatting-fiasco/
I assume that’s going to break the linkages to any existing uploaded images for the field in question. Thanks.
Thanks Ryan- I actually took a stab at it and put it at line 293 above the return.For Mark Huot’s File v. 3.1.1 extension, could someone please show exactly where to insert the line of code?
This info I asked for would be handy for many people, I’m sure, so if anybody knows, please post.
Myself, I just bagged Huot’s File extension altogether, and I’m now using the nGen File Field for Brandon Kelly’s FieldFrame framework. Works great.
http://brandon-kelly.com/fieldframe http://www.ngenworks.com/software/ee/ngen-file-field/
For people with massive weblogs full of entries managed with Huot’s File extension, you’re in for tedious conversion work unless you’re smarter than I am (quite possible).
nGen can be connected to the same Upload Directory you were using with File, and it will let you choose existing files on the server, so you don’t have to re-upload your image files. You do, however, have to re-assign them to the new nGen field.
To do this, I changed Huot’s File field to a text input (and updated all entries), which then contained the file name string when I edited entries, so I could see what file name I wanted. I then manually chose the old file name for nGen File Field in every weblog entry. Tedious, but worth it.
You will also probably have a slightly different system short name for your new nGen File Field, so obviously you’re gonna have to update all your display templates with that short name value. But after those steps, you’re done.
Occasionally, a client will have problems uploading files with Mark Huot’s File module. There’s something about the control panel input that’s malformed or something. It isn’t possible to delete the offending file using the standard mark for deletion way - I have to go in to the database and delete the contents of the custom field in the weblog entry that’s messing up.
I’ve attached a screenshot. Any help would be great!
I noticed this too. I was(am) getting some pixelation in the images (GIF looking) - and I don’t really want to go ahead with File on my current project if the images are going to do that…would you mind going into a little more detail what you did to fix this?You’ll just need to change a few lines in the extension file. Around line #1030 under the heading “Write File” Change from:Change to:if(@imagegif($dst_img, $dst) !== false) {} else if(@imagejpeg($dst_img, $dst) !== false) {} else if(@imagepng($dst_img, $dst) !== false) {}
This will take care of your problem and save your jpeg as a true jpeg. The default image size is set to 60% quality (this is medium in Photoshop)… if you want it set to a higher quality add the number below. (90 means 90% image quality)if(@imagejpeg($dst_img, $dst) !== false) {} else if(@imagegif($dst_img, $dst) !== false) {} else if(@imagepng($dst_img, $dst) !== false) {}
if(@imagejpeg($dst_img, $dst, 90) !== false) {}
I push this one a bit to the front, because i searched a long time, maybe it helps other people too.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.