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.

File Field Doesn't Work Like Docs Say It Should

August 07, 2014 3:47pm

Subscribe [1]
  • #1 / Aug 07, 2014 3:47pm

    Visiluna

    92 posts

    In regards to channel fields of the File type, the EE documentation at https://ellislab.com/expressionengine/user-guide/add-ons/channel/custom_fields.html#file-field states:

    In its most basic form, a File field can be used as a single tag that simply outputs the URL of the file:

    {news_image}

    However, when I use it this way, EE outputs a fully populated image tag:

    <a href="http://mysite.com/images/lead_images/my-image.jpg">http://mysite.com/images/lead_images/my-image.jpg</a>

    According to the same documentation, I’m supposed to have to add the wrap=“image” parameter to get that output.

    It can also be used to create image tags. In this case the filename will be used to create the alt parameter.

    {news_image wrap="image"}

    I really need just the URL. Any help is appreciated.

    I’m currently on EE 2.8.1. Didn’t see this issue addressed in the 2.9 Change Log.

  • #2 / Aug 07, 2014 5:02pm

    Visiluna

    92 posts

    There doesn’t appear to be any way to delete a forum post, so I must hang my head in shame whilst I search for the Idiot button.

    Apparently, when my client created the field in question, it was created as a text field with a file chooser instead of an actual File field.

    My bad for not checking that first.

    I have now created a REAL File field and all is well.

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

ExpressionEngine News!

#eecms, #events, #releases