Can forms be embedded into content items?

cparekh

New Member
Hi,

I've just played around with Fabrik and am very impressed by how quickly a form can be generated.

Is it possible to embed a form into a content item? I'm building a custom component for j1.5 where users can post a question and other users can post answers. So, ideally, a content item i.e. a question, will include a fabrik 'answer' form.

Thanx in advance.

C.
 
Hi terp,

thanks for that - yep, tried it out in a new article and it works great.

Question - how would I display a form in an output file? For my new component I'd like a form to appear below some other dynamic output thus:

<?php if ($user->id > 0)
{
echo "<p>".$row->content."</p>";

echo "<p>".$row->created_by_alias."</p>";

echo "<p>".$row->related_resources."</p>";

echo "<p>Anwer this question:</p>";

echo "{fabrik view=form id=4}";
}
?>

however this only prints {fabrik view=form id=4} literally.
 
You can't invoke mambots with the {...} from inside other component output. The text has to be part of the initial content.

You could try invoking the formbot directly by looking at how mod_fabrik_form.php does it, and rolling your own PHP to drive that code.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top