ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Outputting Image Manipulations

August 02, 2011 1:09pm

Subscribe [10]
  • #1 / Aug 02, 2011 1:09pm

    Caspar

    3 posts

    This question is related to this ‘resolved’ thread.

    I despaired when I read the thread above. Then I bought CE Image as recommended. Then I realised I could really easily output Image Manipulations by using the subfolders it creates and didn’t need CE Image after all (tho it looks cool!).

    So in my example I have a file type channel field called main_image which has an Image Manipulation to resize it for my Sidebar called (imaginatively!) sidebar.

    In my Sidebar template I put the following;

    {main_image}
    {path}_sidebar/{filename}.{extension}
    {/main_image}

    And voila! An Image Manipulation in all it’s glory!!  :cheese:

    I got the {path}, {filename} and {extension} tags from http://ellislab.com/expressionengine/user-guide/modules/channel/custom_fields.html#file_fields

    I hope this is useful for somebody.

  • #2 / Aug 03, 2011 6:37am

    John Henry Donovan

    12339 posts

    Thanks Caspar,

    Moving to Community Help forum so you have the widest audience.

  • #3 / Aug 03, 2011 7:31am

    Caspar

    3 posts

    OK, thanks

  • #4 / Aug 09, 2011 5:56pm

    Tyler Herman

    39 posts

    I was having some trouble with a new 2.2.2 install and both Image Sizer and CE Image, so after some searching I found this method which is great. I’m all for more native functionality, less plugins.

  • #5 / Aug 12, 2011 10:23pm

    CRHain

    8 posts

    Is this something that is going to have a native tag? Why would I want to create a manipulation if I can’t call it quickly and easily? I thought I’d be able to do something like {main_image_sidebar}, but that obviously didn’t work.

  • #6 / Aug 12, 2011 10:33pm

    Tyler Herman

    39 posts

    Native Tag? Maybe I miss understand but It works with whatever custom field you set up. So a file upload custom field called main_image_sidebar would be displayed in the template like {main_image_sidebar}stuff goes here{/main_image_sidebar}.

  • #7 / Aug 13, 2011 10:54am

    CRHain

    8 posts

    What I meant was that the code below seems like a lot of writing just to insert the manipulation into the template.

    {main_image}
        {path}_sidebar/{filename}.{extension}
    {/main_image}

    If I have the {main_image}, I would think that using the manipulated image would be simpler, what with the short name being {sidebar} and ExpressionEngine creating a folder called _sidebar. That’s where {main_image_sidebar} came from. I had also thought of {main_image manipulation="sidebar"} or something.

    I do now realize that in the related post mentioned above, something has been included as a feature request.

  • #8 / Aug 14, 2011 2:01pm

    Tyler Herman

    39 posts

    It is a little long but I think it gives a few more options. I can think of some reasons why you would just want to display the path, or just the filename without the rest of it.

  • #9 / Aug 24, 2011 1:03pm

    dstechroom

    113 posts

    When I did a Google search on how to output Image Manipulations, I first found the aforementioned “Resolved” topic: http://ellislab.com/forums/viewthread/194476/

    It would be really useful if there could be a link for *this* topic, somewhere on that other thread to direct users to a valid solution.

  • #10 / Sep 01, 2011 11:04am

    Frank Harrison

    154 posts

    + 1 to that suggestion! Was pretty worried when I saw that other post, but glad there’s a way round this.

  • #11 / Sep 06, 2011 4:33am

    outline4

    271 posts

    I was also worried when I saw the other post…

    But I am having another problem.
    I am using the file within a matrix.

    {matrix}
       {img_url}
         {path}_thumb/{filename}.{extension}
       {/img_url}
    {/matrix}

    now if “img_url” = “image” and “path” = “/path/” I get the following rendered code:

    image/path/_thumb/image.jpg

    it’s taking img_url as a single variable and then as a variable pair (I am on 2.2.2) and matrix 2.2.2.1
    or am I getting something wrong?

    and: is there a {width} and {height) variable somewhere?

    cheers
    stefan

  • #12 / Sep 07, 2011 8:23am

    DanL

    56 posts

    Thanks Caspar! Worked like a charm.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases