1

Assets 2.0.3; EE 2.5.5

My Assets field is inside a Matrix cell. The Matrix field is named index_slides, and the Assets cell is named full. I want to output just the filename of the file (myfile.jpg). Here's the code I'm using:

{index_slides}
    {full}
        <p>The name of this file is {filename}</p>
    {/full}
{/index_slides}

Instead of outputting "myfile.jpg" as expected, it outputs the full file path ("http://mysite.com/my/upload/dir/myfile.jpg"), which should be what the {url} variable is for.

  • 1
    I cannot reproduce this myself. – Derek Hogue Jan 25 '13 at 15:42
  • I also can not reproduce this. kgrote - is that your entire template code? More template context would help quite a lot here, I suspect. Thank you! – Lisa Jan 25 '13 at 17:18
  • Where is the image located – an EE upload directory or Amazon S3? – Brandon Kelly Jan 26 '13 at 23:58
1

The issue seems to be that I'm using a single variable farther up in the tag pair, like this:

{index_slides}
    {exp:ce_img:single
        src="{full}"
        width="500"
        height="300"
        alt="{alt}"
        crop="yes"
    }
    {full}
        <p>The name of this file is {filename}</p>
    {/full}
{/index_slides}

That seems to be getting Assets all confused, which is understandable.

| improve this answer | |
0

can you try by putting the code like:

{index_slides}
    {full}
        <p>The name of this file is {file_name}</p>
    {/full}
{/index_slides}

as asset cell also treat as file field type so it may work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.