Page 1 of 1

Newsmodule - problem with file fields

Posted: Thu Sep 04, 2014 1:13 am
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 ;)

Re: Newsmodule - problem with file fields

Posted: Thu Sep 04, 2014 7:38 am
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)