Hi,
I used ChronoForms for many years, but I never realized the potential of using CF with CC... good job!!
I'm trying to create an Q&A "application".
I created two Forms:
1) Questions where the data are stored in #__questions -----> | id | unique_id | user_id | question_title .......
2) Answers where the data are stored in #__answers -----> | id | unique_id | user_id | question_id | answer_title .......
So with CF (form "questions") user can create a new Question.
With CC I'm able to display all the questions and in the Custom Body List I inserted a "Reply to this Question" button with this code
Clicking on this button will open the form "Answer" and with
In CC on the Front List Settings I set the question title as View linkable.
Now the tricky part.
Clicking on the question title will open the question View with all the question data taken from #__questions + only the first corresponding answer from #__answer.
I would like to show all the answers to the selected question.
CC SETTINGS
[list]Models Title = question; Tablename = #__questions
Models Title = answer; Tablename = #__answers; Relation: hasOne; Foreign key: question_id[/list]
Thanks in advance
I used ChronoForms for many years, but I never realized the potential of using CF with CC... good job!!
I'm trying to create an Q&A "application".
I created two Forms:
1) Questions where the data are stored in #__questions -----> | id | unique_id | user_id | question_title .......
2) Answers where the data are stored in #__answers -----> | id | unique_id | user_id | question_id | answer_title .......
So with CF (form "questions") user can create a new Question.
With CC I'm able to display all the questions and in the Custom Body List I inserted a "Reply to this Question" button with this code
<form method="post" action="index.php?option=com_chronoforms5&view=form&Itemid=178">
<input type="hidden" name="question_id" value="{question.id}" />
<input type="submit" value="Reply to this question" />
</form>
Clicking on this button will open the form "Answer" and with
$_POST['question.id']
I can make a relation between Questions and Answers ---> #__answers[question_id] == #__questions[id]
In CC on the Front List Settings I set the question title as View linkable.
Now the tricky part.
Clicking on the question title will open the question View with all the question data taken from #__questions + only the first corresponding answer from #__answer.
I would like to show all the answers to the selected question.
CC SETTINGS
[list]Models Title = question; Tablename = #__questions
Models Title = answer; Tablename = #__answers; Relation: hasOne; Foreign key: question_id[/list]
Thanks in advance