Joomla 'article custom fields' in form

PeekPoke 10 May, 2019
Hello everybody, Hi Bob
(Excuse me, I do not speak English well)
In Joomla I have defined in the article 5 custom fields (date). In the article I can get these with {field 1} {field 2} and so on.
In Chronoforms I want to let you select these 5 fields with radio buttons.
How do I proceed correctly?
Thank you for your help! 😉
Greeting
PeekPoke
​
healyhatman 10 May, 2019
Custom fields are stored in #__fields_values. The field ID is the field ID, the value is the value, and the item id is the article ID.
PeekPoke 10 May, 2019
Thanks @healyhatman:
I'm a bit confused by all the descriptions and short command statements. Is there a kind of step by step guide to it so I can see what needs to be used where?
Not being as fluent in the English language, this is an additional challenge - so I'm grateful for a clearer guide.
How do I manage to use the 5 fields mentioned in a radio button set as a selection in the form?
Thank you very much for your support and constructive hints.
René
​
healyhatman 10 May, 2019
You need to explain better what you're trying to do.
PeekPoke 10 May, 2019
In Joomla, I have opened five date fields for articles (date1, date2, date3, date4, date5).
The articles are used for course descriptions and the date fields to record possible course data.
The entered course data should be available for selection in the form.
These are probably radio buttons the best choice.
I hope I could put it clearly.
Many thanks, René
healyhatman 10 May, 2019
So you'll need to read the #__fields_values table, and the item id will be the article ID for the article you're looking at. Set it to return an array of key value pairs, and just retrieve the value field in Fields to Retrieve. Use {var:read_data#} as the values for the radio buttons. Replace # with the number in the black label of your read data action
PeekPoke 10 May, 2019
Thank you for your patience. 😲😗
Do I have to set "Read Data" in "Action"?
There are so many options, where do I have to enter something?
healyhatman 10 May, 2019
You might need to go back and look at the demo form and read the manual. But yes the read data action is in actions
PeekPoke 10 May, 2019
You are absolutely right healyhatman! 😉 I have now read in the Manual. Thanks for that.
Well, now I'm starting to understand a lot better. With the documentation and your valuable information, which I can now understand.
I have set "read data" (printscreen) and radio-buttons.
but I make somewhere a mistake as you can see in the issue (printscreen 2).
What do I have to change so that the issue is correct?
It should be displayed per radio button a Date.
​
Second question is, how is the order to enter the current article id?
At the moment I have entered the test "11", because this is an article id.
​
Thanks for help and regards
Joomla 'article custom fields' in form image 1
​
Joomla 'article custom fields' in form image 2
​
Joomla 'article custom fields' in form image 3
healyhatman 10 May, 2019
Just put the {var: once mate
PeekPoke 10 May, 2019
Excuse me, what do you mean? google does not translate "once mate". 😀
​
Second question is, how is the order to read the current article id?
At the moment I have entered the test "11", because this is an article id.
healyhatman 10 May, 2019
Just put the {var once in your value setup.
​
You have {var:read_data1}={var:read_data1} when it should just be {var:read_data1}
PeekPoke 10 May, 2019
hmmm.. look.. face-meh-blank
Joomla 'article custom fields' in form image 4
​
Joomla 'article custom fields' in form image 5
healyhatman 10 May, 2019
You haven't set the read data to return an array of I'd value pairs, like I said to. You probably still have it set to return all matching
PeekPoke 11 May, 2019
YES! 🤣 you are great!
​
Joomla 'article custom fields' in form image 6
now..
how do i format the date?(D.m.Y)
and how do I read the article id?
​
I'm learning, thanks 😉
healyhatman 11 May, 2019
In this case you should format it with MYSQL. I'm out right now so you'll have to Google it. As to reading the article ID, well how are you getting the right article now?
PeekPoke 11 May, 2019
For testing, I have set an article id for "where"> "value" directly: "11" (you can see it in one of the printscreens).
​
I know how to format the date - I just do not know where to use it in chronoforms.
healyhatman 11 May, 2019
For the article ID you can put in as a URL parameter and get it with {data:paramname}
PeekPoke 11 May, 2019
I'm sitting here in Switzerland and it's already 02:38 in the morning.😀
I'll look at it tomorrow when the head is more active again ..thank you first for your help .. you are really great!
PeekPoke 12 May, 2019
hi healyhatman, I have replaced the five fields from date-fields to normal text-fields.That is also fine and I bypass the formatting. 😀 With that I generate the new situation that I have to sort the output-order with the field "field_id" (ASC). I put in "Order fields" so "field_id" or "fields.field_id" and get the error message that the column does not exist!? After I have also specified this field in "Fields to retrieve", it will be printed correctly in the form, in the radio-buttons - but if I put the field in the email {data:termin} there is the content of "field_id".It is certainly just a trifle that I have to change, and I am once again happy for your help.
Joomla 'article custom fields' in form image 7
healyhatman 12 May, 2019
Field ID is wrong, you only want the value
PeekPoke 12 May, 2019
When I remove felder.field_id from "Fields to retrieve", I get the following error:
1054 - Unknown column 'felder.field_id' in 'order clause'
face-meh-blank
healyhatman 12 May, 2019
Well take it out of the sortable fields. Also get rid of the special field.
PeekPoke 12 May, 2019
Answer
so easy, it works! 😃 I learned a lot from you, thank you! 🤣

Incidentally, this is how I get the article id:
$view = JRequest::getVar('view');
$article_id = null;

if ($view == "article") {
$article_id = JRequest::getInt('id');
}
return $article_id;
and so I get the page title:
<?php
$article_title = '';
$id = \JRequest::getInt('id', '');
$article = \JTable::getInstance('content');
$article->load($id);
$article_title = $article->get('title');
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $article_title; ?>' />
This topic is locked and no more replies can be posted.