Hi
I have created a form and I am 99% ready to deploy it live, but its that last 1% that is driving me nuts!
Basically, I have a set or articles that are each an event and I want to use just one booking form for all events. Simple, but on each event article there are 8 custom Joomla fields some of which I read into the form to populate certain fields. This is all working.
Reading the custom fields into an array using a read data action.

Turning on the debugger, I was able to determine the order of the fields in the array.
Populating fields in the form with the data returned in the array is achieved by using the “Values & Placeholder” option in the advanced settings.

My problem is the 546 (ringed in yellow) in the data read (first image). This is the articleID of the test article I am using. I want to replace 546 with the articleID (programmatically) of the event article of the article being used.
Back to the title of this post. Is it possible to get the articleID into a global variable that can used in the Data Read?
I have tried a block of PHP before the data read using the following two lines of code, neither have worked.
$ID = JRequest::getInt('id');
And
$ID = (JRequest::getVar('option')==='com_content' && JRequest::getVar('view')==='article')? JRequest::getInt('id') : 0;
Now stumped! Any help would be greatly appreciated.
Cheers
Colin
I have created a form and I am 99% ready to deploy it live, but its that last 1% that is driving me nuts!
Basically, I have a set or articles that are each an event and I want to use just one booking form for all events. Simple, but on each event article there are 8 custom Joomla fields some of which I read into the form to populate certain fields. This is all working.
Reading the custom fields into an array using a read data action.

Turning on the debugger, I was able to determine the order of the fields in the array.
Populating fields in the form with the data returned in the array is achieved by using the “Values & Placeholder” option in the advanced settings.

The construct of the value
{var:read_data_39.6.ReadCustomFields.value}
read_data_39 - The ID of the “Read Data”
6 - Is the index element of the returned array. IE the field I want.
ReadCustomFields - Is the model name used in the “Read Data”
My problem is the 546 (ringed in yellow) in the data read (first image). This is the articleID of the test article I am using. I want to replace 546 with the articleID (programmatically) of the event article of the article being used.
Back to the title of this post. Is it possible to get the articleID into a global variable that can used in the Data Read?
I have tried a block of PHP before the data read using the following two lines of code, neither have worked.
$ID = JRequest::getInt('id');
And
$ID = (JRequest::getVar('option')==='com_content' && JRequest::getVar('view')==='article')? JRequest::getInt('id') : 0;
Now stumped! Any help would be greatly appreciated.
Cheers
Colin