• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with News Module Custom fields
PostPosted: Tue Oct 16, 2018 3:38 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 08, 2018 4:59 pm
Posts: 37
I have three custom fields in my news module. They are called image, image2 and image3.

I'm not able to call any of them individually except the 'image' one the other don´t show up if I call them.

this is the code I'm using to call the custom fields

Code:
<img src="{$entry->file_location}/{$entry->fields.image->value}"/>
<img src="{$entry->file_location}/{$entry->fields.image2->value}"/>
<img src="{$entry->file_location}/{$entry->fields.image3->value}"/>


for some reason this code only works for the 'image' custom-field.

Obviously I can see all the three images if I use this loop below.

Code:
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="PostImg">
        {if $field->type == 'file'}
     {* this template assumes that every file uploaded is an image of some sort, because News doesn't distinguish *}
          {if isset($field->value) && $field->value}
            <img src="{$entry->file_location}/{$field->value}"/>
          {/if}
        {else}
          {$field->name}:&nbsp;{$field->value}
        {/if}
     </div>
  {/foreach}
{/if}



But if I want to display the images from the custom field separately I get into troubles as I described above.

Can anyone here hlep me figuring this out.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Problem with News Module Custom fields  Topic is solved
PostPosted: Tue Oct 16, 2018 3:41 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 08, 2018 4:59 pm
Posts: 37
Nevermind.....I posted for help too soon...

the problem was bad naming :)

I named the custom fields Image2 and Image3 instead of image2 and image3.

my bad....


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting