Well i have the answer. Got it out of
this threat. Here an explanation
How you change field values with BeforeStore Plugin
Generell Info
- It is necessary that you can read php arrays.
- $config (features)
- Is an multidimensional array
- Contains the values who are gonna saved
- You need to address your value within this array
- You are able to call field values with $fields['myfield']->value
- You can you use joomla classes
Step by Step
- Find out how to address your value within the $config
Tipp: Use var_dump($config);die();) within your BeforeStore field, to have an look to the array. Switch in your Browser to the source code view.
- If your field has the name "myfieldname", there could be come out something like this, to address your field value
$config['storages']["#__cck_store_form_mycontentview"]["myfieldname"]
- Make the manipulation / change of your field value
// Example 1 - Just Text
$config["storages"]["#__cck_store_form_mycontentview"]["myfieldname"] = "I changed the value of myfieldname with BeforeRender";
// Example 2 - Get the value of another field
$config['storages']["#__cck_store_form_mycontentview"]["myfieldname"] = $fields["anotherfieldname"]->value;
// This works on unsaved values of "anotherfieldname" - Its means you just typed it in the SiteForm