7 Posts
fasenderos
9 years ago
1
Topic

Hi,

i'm trying to understanding the 42 field type.

With 42 i can use php to get some custom values.

My question:

if I have to store for ex 10 custom values on 10 different columns, I have to create 10 different 42 fields?? Or I can do the same with one single 42 field??

For now I'm able to store 1 value for each 42 field. 

Of course I would prefer to have just one 42 field to store these 10 different values in 10 different columns. Is it possible?

Thanks in advance

Get a Book for SEBLOD
9 years ago
0
Level 1

Hi fasenderos,

the 42 field allow you to generate your own php code for events :

  • PrepareContent (set $value)
  • PrepareForm (set $form)
  • PrepareStore (set $value)

But you don't have access to other fields in the form.

If you need to modify or generate the value of fields depending on other fields, the best way is to use a plugin Field Code :

  • beforestore  => see tutorial below
  • afterstore  => write your own code to change values directly in database

in those events you have access to all fields of the form in the variable $fields


Regards.

Lionel

Get a Book for SEBLOD