Content plug-in3
From Fabrik
The main Fabrik plug-in allows you to embed Fabrik content within your Joomla articles
The syntax for using the plug-in is written in the description field, and is duplicated below for your convenience:
Contents |
Forms
{fabrik view=form id=1} Will allow you to add a new record to a form whose id is 1
{fabrik view=form id=1 row=1} will let the user edit that form's row 1.
{fabrik view=details id=1 row=1} will show a read only view of that form's row 1.
{fabrik view=form id=1 usekey=user rowid=62} will load form 1, and look for an existing record where the 'user' element has a value of 62. It is such a perfect internet site! Nonetheless, is it real to find some term papers writing helper here? I am willing to buy college research paper! Please give me your suggestions! If it finds it this record will be loaded for editing, if not found a new record can be entered
{fabrik view=form id=1 usekey=user|status rowid=62|1} will load form 1 and look for an existing record where 'user=62 AND status=1' - you can add as many key/value pairs as long as you ensure that each value is separated by a '|'
Lists
{fabrik view=list id=1} to insert a list whose id id 1.
{fabrik view=list id=1 tablename___elementname=foobar} will filter the list to show only records where 'elementname' has a value of 'foobar'
{fabrik view=list id=1 tablename___elementname=[param1]} will replace [param1] with the value of param1 in the URL (e.g. URL ...option=com_content&view=article&id=11¶m1=foobar)
{fabrik view=list id=1 resetfilters=1} will reset any applied filters
{fabrik view=list id=1 showfilters=0} will hide the filters
Filtering list
Show rows where elementname1 is 'abc' AND elementname2 is one of 1, 4, 8, or 2:
{fabrik view=list id=4 listname___elementname1=abc listname___elementname2[value]=1,4,8,2 listname___elementname2[condition]=IN}
As you can see you may use almost any string as condition value.
Those strings have to be "url encoded". So any characters which aren't "legal" on a URL have to be replace with their %xx equivalent. The most common example is a space (%20), but there are others like single or double quotes.
You can generate urlencoded strings by using online tools like ...
http://www.opinionatedgeek.com/dotnet/tools/urlencode/Encode.aspx
Pay your attention that when you use [condition] or similar (see below) for any field, you MUST use [value] for this field too.
You may specify several values for one field using this syntax (may be necessary for some operations like BETWEEN, see example below):
{ ... listname___elementname[value][]=100 listname___elementname[value][]=200 ... }
By default is equal condition is used for any value specified for row field. You may specify your own condition for each such field. List of possible conditions is:
<>
<
>
IN (you need a comma-separated list of integers without surrounding quotes or parentheses as a value, see example above. I know nothing about list of text values but suppose each list item should be quoted)
CONTAINS (you should specify a string as a value, and rows containing this string in specified field will be listed)
BETWEEN - see examble below
may be more... I suppose.
By default all conditions specified joins with logical AND - they should match all together. If you want OR instead of AND - add this for all your conditions (may be except the first):
{ ... listname___elementname2[join]=OR }
Theoretically you may combine AND and OR joins but I'll not explain it because of:
- complexity
- lack of use. AND always executes before OR and I know no 'operation parentheses' for Content plugin. So most likely the result of combining AND and OR will be not those you want.
Ranged filters:
{fabrik view=list id=4 listname___elementname[value][]=28/10/1999 listname___elementname[value][]=28/10/2000 listname___elementname[condition]=BETWEEN}
note that the date should be in the table view format, not as a mysql date format.
Notice: the element name format listname___elementname_raw is not usable here although we use this kind of element name when filtering lists by database join or cascading dropdown element data. Use just listname___elementname instead, especially when we want display data dynamically using placeholder for a variable (e.g listname___elementname=[rowid]). In content plugin, it retrieves raw data for filter even when there are dbjoin or cdd elements while _raw could generate some problems.. See http://fabrikar.com/forums/showthread.php?t=22860
Notice: Filters defiined inside {fabrik view=list......} are sticky and can not be unset by the user. As such they behave in a similar fashion to list prefilters
Visualizations
{fabrik view=visualization id=1} will show visualization id 1
resetfilters, showfilters see "Lists"
Element data
{fabrik view=element list=11 rowid=239 element=element_test___checkbox} to insert table 11 row 239's checkbox element's data
- repeatcounter - specify the repeat records value you want to use. Defaults to 0
Common modifiers
For which ever view you choose you can change its template by adding 'layout=templatename'
Add 'show-title=0' to hide title

