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?
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?
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
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
How can I get the article ID of a new article I try to submit before it gets submitted?😛
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
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
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.
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.
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
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
This topic is locked and no more replies can be posted.