Content Plugin : pass parameters to forms

Incremental

Member
Hi,
after reading documentation and a few tests, I need some help !

I have designed a 'generic' contact form usable for multiple customers.
Each customer has a table with his parameters (name, mail, ...)
To add a contact with the form, I would like to fill the CustomerID field with the ID provided in the Joomla article.
for this I use Content Plugin in Joomla :
{fabrik view=form id=1}
but I would like now to pass a parameter to the form to fill automatically the correct element, with something like :
{fabrik view=form id=1 CustomerID=3}

The only examples I found are to customize visualisations.

  1. How to pass a parameter to an adding form ?
  2. How to populate a form element with this parameter ?
  3. How to retrieve this parameter in the PHP validation plugin of the form ?
I'm stuck now and help would be great !
Thanks
 
Use the "usekey" feature
http://www.fabrikar.com/forums/index.php?wiki/content-plugin/#searching-for-form-records-to-edit
so in your case
{fabrik view=form id=1 usekey=CustomerID rowid=3}

To get the a rowid=foo from your URL (assuming URL = ....option=com_content&view=article&id=2&myparam=foo
{fabrik view=form id=1 usekey=CustomerID rowid=[myparam]}

So if you are using a URL in a redirect plugin or in a custom element link you can create a URL
option=com_content&view=article&id=2&myparam={an-element-of your-form}
 
Thanks troester for your answer, but according to the Content plugin wiki :
{fabrik view=form id=1 usekey=CustomerID rowid=3} is for retreiving an existing record where CustomerID=3
In debug mode, it performs a SELECT WHERE ( `contacts`.`ContactsFormID` = '3')

In my case, I would like to create an new record with CustomerID=3
I tried the syntax before, but my CustomerID element is empty ! Do I missed something to fill it with 3 ???
 
Ok, I've missunderstood you.

You must use the full element name (also wrong in my example)
{fabrik view=form id=1 your-table___CustomerID=3 your-table___an-other-element=abc}
 
Wow you're a god ! it works fine ! and Fabrik is great !
I've added it to the Wiki.
Now, I've triggered a database join in the form, with that value :)

Do you know where there's a good documentation about placeholders ?
In the new Wiki I can't find them and a search returns me many forum topics.
Fabrik has a lot of power in placeholders, but the documentation is poor and I would be happy to enhance it.
Thanks a lot
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top