Add chronoforms data to custom fields

huubs 16 Mar, 2017
I have made a plugin which adds extra fields to an Joomla article, described here: https://docs.joomla.org/Adding_custom_fields_to_core_components_using_a_plugin

The values of these fields are saved in the params of the item ($this->item->params) under a specific key (gec_year, gec_price). Now I know how to add an article with the add article event, but how can I save the values I get from the form into these params fields? Probably with a custom code event?
GreyHead 16 Mar, 2017
Hi huubs.

Yes if you can get the article ID (from the URL, the page title or the menu info) then you should be able to load the params and access the data.

Bob
huubs 16 Mar, 2017
How can I get the article ID of a new article I try to submit before it gets submitted?😛
GreyHead 16 Mar, 2017
Hi huubs,

Sorry, I misunderstood the question :-(

The article ID is added to the $form->data array after the Joomla! Article action so you can use that in a Custom Code action.

Bob
huubs 17 Mar, 2017
Hi,

Ah ok, thanks. And how can I get the article data in the custom code? With a database query I presume?

And to save the data in the article I need to write to the database? Is there any example code for this?

EDIT: Ok I checked the form->data array but I cannot find the article ID from this data array.
GreyHead 17 Mar, 2017
Hi huubs,

My apologies I have checked and the id isn't added. :-( You'd need to look it up from the new article title.

I imagine that you can use the Joomla! article object to update the parameters but that is a Joomla! question rather than a ChronoForms one.

Bob
huubs 17 Mar, 2017
But what if I have the same names from the article?
GreyHead 17 Mar, 2017
Hi Huubs,

The the most recent one is probably the one that you are looking for,

Bob
This topic is locked and no more replies can be posted.