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.

Displaying multiple files using file field....

February 02, 2011 2:47pm

Subscribe [2]
  • #1 / Feb 02, 2011 2:47pm

    blaiseymae

    108 posts

    I am using a “file” field to allow publishers to upload related documents that may accompany their news stories.

    If there is only one document, everything works great, but if there is a second document, it seems like it’s replace the first one in the entry.

    The documents are being uploaded without any problems, but I cannot figure out how to link to more than one.

    Code below 😊

    {exp:channel:entries channel="treatment" limit="1" status="Open|Public" track_views="one" disable="pagination|member_data|trackbacks"}
    
    <b>Related Document(s):</b> {alternativeModes wrap="link"}
    
    {/exp:channel:entries}

    Thanks 😊

  • #2 / Feb 03, 2011 7:31am

    John Henry Donovan

    12339 posts

    blaiseymae,

    The file field only takes one image/document at a time.
    You will have to create a second file field below this if you wish your client to add more

    You then add that custom field to your template and check for a value first before showing it

    
    <b>Related Document(s):</b> 
    {alternativeModes wrap="link"}
    {if alternativeModes2 != ''}{alternativeModes2 wrap="link"}{/if}
    
    

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases