Newsmodule - problem with file fields

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kwakier
New Member
New Member
Posts: 2
Joined: Tue Apr 02, 2013 12:49 pm

Newsmodule - problem with file fields

Post by kwakier »

Hello!
I have a little problem with news module. Detail template did not shows more then 3 images uploaded by file fields. I used simple code to do this:

Code: Select all

{if isset($entry->fields)}
{foreach from=$entry->fields item=’field’}

{if $field->value != ” }
file_location}/{$field->displayvalue}” data-lightbox=”{$entry->file_location}/{$field->displayvalue}”>
file_location}/{$field->displayvalue}”/ height=”100″>

{/if}
{/foreach}
{/if}
I tried also display every single field with this:

Code: Select all

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
    
        {if $field->name == 'photo1' && $field->value != '' }

<a href="{$entry->file_location}/{$field->displayvalue}" data-lightbox="{$entry->file_location}/{$field->displayvalue}">
          <img src="{$entry->file_location}/{$field->displayvalue}"/ height="100">
       </a>

        {/if}
   
  {/foreach}
{/if}
...but detail template always shows only 3 photos doesn`t matter how many photos I uploaded ofcourse every single by another file field.

Please help me.

(Sorry for my English if there is something wrong with grammar ;)
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Newsmodule - problem with file fields

Post by velden »

To troubleshoot:

You can try to add {debug} at the top of the news detail template. Then on frontpage load the news detail page and make sure to allow popups.

You can also add

Code: Select all

<pre>{$entry->fields|print_r}</pre>

to the template so it will print the contents of fields.

Post system information (at least version of CMSMS and News module)
Post Reply

Return to “Modules/Add-Ons”