We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

File

Development and Programming

Herudea's avatar
Herudea
9 posts
17 years ago
Herudea's avatar Herudea

Matt- THANKS! I was using the entries tag from my hompe template (cause I knew at least that one worked) and the custom field for this other weblog(for images) was name “images”… go figure.

So this is wat I have now:

{exp:weblog:entries entry_id="9" }
    {image}
{/exp:weblog:entries}

but I would like to use the ‘file_url’ attribute becuase as you probably know, this is what that produces:

<a >


doors.jpg
" alt="Welcome In!" >

I couldn’t figue out how the ‘file_url’ is used…any help? Gosh I appreciate it man.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

Try using it as a variable pair:

{exp:weblog:entries entry_id="9" }
    {image}{file_url}{/image}
{/exp:weblog:entries}
       
Herudea's avatar
Herudea
9 posts
17 years ago
Herudea's avatar Herudea

Soory, I failed to mention that I had actually tried that… and it renders the tags like:

{image}{file_url}{/image}

Exactly like it is inputed…so I figured I must have been doing something wrong. I just tried it again with your code too. Does {images} need to be plural? Thats only for multiples..? You guys rock.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

Fixed via PM.

       
Chad Clark's avatar
Chad Clark
20 posts
17 years ago
Chad Clark's avatar Chad Clark

Hello all. I am encountering an issue while trying to use the {count} function with the File extension.

I have made a custom field in which multiple image files are attached. The images are then pulled into an unordered list and shown in a jQuery gallery.

I want a line of text to appear if there is more than one image so the user knows to click to see the next image. Obviously, I do not want the text to appear if there is only one image.

My issue is that this text is appearing twice. Below is my code:

<div class="preview">
{self_mailer_preview}{if {count} != 1}Click on image to see more views{/if}{/self_mailer_preview}
<ul class="gallery">
{self_mailer_preview}<li>{file_url}</li>{/self_mailer_preview}
</ul>
</div>

Any help would be greatly appreciated.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

All the code within the {self_mailer_preview} {/self_mailer_preview} tags is going to repeat for each image uploaded to the field. So if you have three images, that code is going to repeat three times. On the first loop, count will = “1” so the code won’t show. On the second two count will not = “1” so the code will show.

By the way, you may want to use {total_results}, and not {count} for this (although there are some glitches with {total_results} and {count} and adding/removing files that I’ve seen):

What about this code– not the neatest in the world, but probably workable:

<div class="preview">
    {self_mailer_preview}
        {if ({count} == 1) && ({total_results} > 1)}
            Click on image to see more views
            <ul class="gallery">
        {if:elseif {count} == 1}
            <ul class="gallery">
        {/if}
        <li>
            {file_url}
        </li>
        {/self_mailer_preview}
    </ul>
</div>
       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi all…

I love this extension, but have a small problem. I want to use the same file on multiple weblog entries. So basically what I need is to be able to upload the file using this fantastic extension, OR select a file from a list (drop-down?). Has anyone come across this issue, or better yet found a solution?

Thanks in advance.

       
RJB's avatar
RJB
35 posts
17 years ago
RJB's avatar RJB

I’m having an issue with File 3.1.1 and ExpressionEngine 1.6.3 where the “Resize Images” setting isn’t honored and resets itself to “Auto” every time I update/save the preferences at “CP Home > Admin > Section Administration > File Upload Preferences”.

When this happens, the File extension generates a resized thumbnail for every image uploaded (due to the Auto resizing selected).

I’d like to have the File extension honor my “Resize Images” setting of “None” so that I don’t needlessly have thumbnails generated (since I don’t need them for my specific application).

The server is a RHEL 4 machine with Apache 2.0.52 and PHP Version 4.3.9. I’ve confirmed this behavior on two different installations of ExpressionEngine (on two separate servers).

Is anyone else having the same problem or know of a resolution and/or work-a-round?

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

Ryan– If I understand correctly, you want to resize the image and only keep the resized version, without a thumbnail. is “Keep Originals” set to no? If it’s set to yes, try setting to “no” and see if that works better.

Edit: No, I was mistaken– you want it to never be resized. First, set “Keep Originals” to no, so only one image is made. In your database, in the exp_mh_file table, is the resize set correctly to none or does it say auto? what if you manually make it “Auto” (or try lowercase “auto”)?

-Matt

       
xopher's avatar
xopher
12 posts
17 years ago
xopher's avatar xopher

My experience with this extension has been that it works GREAT… except, I can’t limit the dimensions of uploads. If I put a max width/height it applies to the THUMB that is generated, but the original is untouched.

Ideally I would prefer to set a max width/height for both the uploaded image and the thumbnail. Anyone else find this to be a problem? Or am I alone in thinking this needs just a bit more refining?

Maybe my settings are just off? Mine are attached.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

I think it’s because you have “Keep originals” on. My experience is there are these two scenarios:

  1. “Keep originals” is on. In this case, you get two copies of the image. One is the original image, and one is the thumbnail set to the dimensions you wrote in.
  2. “Keep originals” is off. In this case, your one copy of the image is the resized one.

Does that answer your question?

       
xopher's avatar
xopher
12 posts
17 years ago
xopher's avatar xopher

I wish it did. What I want, is to prevent people from uploading 3MB photos… but I also need thumbnails. So on upload I would like the photo resized and the height/width constrained to 800px for instance… but I also want a 150px thumbnail to be generated.

The two scenarios you described are exactly what I experience, and precisely the problem. I can’t constrain the size/dimensions of uploaded images unless I leave thumbnails turned off.

I’ll keep trying/tweaking and post back if I resolve this issue. I’d love to hear from Mark on this so maybe he could explain his thinking in creating this–maybe I could alter my thinking if I could understand the origins of this behavior.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg
I’d love to hear from Mark on this so maybe he could explain his thinking in creating this–maybe I could alter my thinking if I could understand the origins of this behavior.

He hasn’t answered here in quite a while. This should be possible to fix by modifying the extension yourself though. If your thumbnails are going to always be 150px, you could hardcode that into the extension and then use the dimensions settings to resize the full image.

       
RJB's avatar
RJB
35 posts
17 years ago
RJB's avatar RJB
I think it’s because you have “Keep originals” on.

Ahh, I changed “Keep Originals” to “Off” and the File extension no longer makes a thubmnail from the uploaded image – this is a good thing!

Does that answer your question?

However, I still have a remaining problem in that I cannot select “None” (or any other choice for that matter) for the “Resize Images” setting.

Every time I select a choice and Update the preferences it reverts back to “Auto” (which seems to suggest something is not working correctly and my preference is not being honored by the Extension). Thoughts?

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

What if you do as I said earlier– try to adjust it directly in the database.

       
First 34 35 36 37 38 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.