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.

3
  • 1
    I cannot reproduce this myself. Jan 25, 2013 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, 2013 at 17:18
  • Where is the image located – an EE upload directory or Amazon S3? Jan 26, 2013 at 23:58

2 Answers 2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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