Page 1 of 1

Module: FEU Uploads custom fields

Posted: Fri Sep 07, 2018 11:25 am
by blackrain
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: Select all

{$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

Re: Module: FEU Uploads custom fields

Posted: Fri Sep 07, 2018 1:58 pm
by blackrain
I have used this to get me over the issue but I really need to be able to access the individual custom field.

Code: Select all

{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

Re: Module: FEU Uploads custom fields

Posted: Sat Sep 08, 2018 3:29 pm
by PinkElephant
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: Select all

	{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.

Re: Module: FEU Uploads custom fields

Posted: Mon Sep 10, 2018 8:49 am
by blackrain
Thank you @PinkElephant, that works perfectly.