• 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.  [ 4 posts ] 
Author Message
 Post subject: Module: FEU Uploads custom fields
PostPosted: Fri Sep 07, 2018 11:25 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Feb 20, 2008 4:33 pm
Posts: 64
Location: London, England
I am trying to add custom fields to the uploads module.

I created a custom field (dropdown) and added values. however I am not able to show the value of the dropdown on the front end.

I have tried the usual
Code:
{$entry->fielddefs->section.value}
{$entry->custom_field->section}

etc..

but no results are shown, any idea what the correct syntax is for this please.

many thanks

Mark


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Module: FEU Uploads custom fields
PostPosted: Fri Sep 07, 2018 1:58 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Feb 20, 2008 4:33 pm
Posts: 64
Location: London, England
I have used this to get me over the issue but I really need to be able to access the individual custom field.

Code:
{if isset($entry->fields)}
    {foreach name=fields from=$entry->fields key='fldname' item='field'}
         {$field.value}
    {/foreach}
{/if}


if I add more fields the returned data would be concatenated.

Thanks


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Module: FEU Uploads custom fields  Topic is solved
PostPosted: Sat Sep 08, 2018 3:29 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Feb 06, 2009 2:08 pm
Posts: 148
blackrain wrote:
access the individual custom field

Installing the module (so much good work here) and using a test-category and couple of field definitions, imaginatively named test-field-definition-01 (text) and test-field-definition-02 (dropdown) and ...

Code:
   {if isset($entry->fields)}
      <h2>Debug</h2>
      <pre>
         {* print_r($entry->fields) *}

         01 name: {$entry->fields['test-field-definition-01']['name']}
         01 value: {$entry->fields['test-field-definition-01']['value']}

         02 name: {$entry->fields['test-field-definition-02']['name']}
         02 value: {$entry->fields['test-field-definition-02']['value']}
      </pre>
   {/if}


... bingo.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Module: FEU Uploads custom fields
PostPosted: Mon Sep 10, 2018 8:49 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Feb 20, 2008 4:33 pm
Posts: 64
Location: London, England
Thank you @PinkElephant, that works perfectly.


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.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: googlebot


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