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.

EE 2.5.5 Using File custom field.

February 15, 2013 10:47pm

Subscribe [0]
  • #1 / Feb 15, 2013 10:47pm

    iPixel

    64 posts

    So, in ee1.x this seemed to work differently via nGen File. Now that ee2.x has it’s own file field, I have come across a question/concern.

    Let’s assume we created a {item_image} custom “file” field.

    When using that field, {item_image} automatically gives you the absolute URL path to the image that was uploaded.

    My issue is that i also used ee’s Image Manipulations to create a _default folder with images sized to a smaller size. But again, using {item_image} points directly to the original file.

    How can I do one of the following.
    1. Stop EE from assuming i want the absolute URL and just give me the image name only.
    2. Tell EE to use that same image but within the _default folder EE itself created.

    btw, _default is no different from ee’s _thumbs just contains slightly larger images.

    Thanks for the help in advance!

  • #2 / Feb 16, 2013 12:33am

    Bhashkar Yadav

    727 posts

    I hope, this example code would answer your both questions:

    {exp:channel:entries channel="CHANNEL_NAME"}
     ITEM IMAGE NAME: {item_image} {filename} {/item_image}
        {item_image}
            {path}_default/{filename}.{extension}
        {/item_image}
    {/exp:channel:entries}

    Best Regards,

  • #3 / Feb 16, 2013 12:43am

    iPixel

    64 posts

    Yep, this is EXACTLY what I needed! Thank You Bhashkar!

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

ExpressionEngine News!

#eecms, #events, #releases