Unclear About Form, Table, & Detail Views?

MatthewSchenker

New Member
Greetings,
I'm trying to fully understand Fabrik's templating system. I sort of get parts of it, but not the whole picture.

There are three main areas that need focus in any CCK:
1. The view for the form
2. The table/list view
3. The detail/item view

I'm sort of figuring out number 1 and 2. Fabrik has ways to reference templates for 1 and 2.

But I'm getting stumped on number 3. How do I control the layout of a particular record in Fabrik?

I might be missing something obvious, due to my own design process. I'm accustomed to creating view files for all the ways I need to present information, then I call those views in controllers as needed. I usually have one view file for each particular page layout.

can someone shed more light on the way Fabrik does this? The Wiki is not quite explaining it all.

Thanks,
Matthew
 
When editing your form you can define different templates (layouts) for form view and detailed view.

If you are using the content plugin you can do
{fabrik view=form...layout=xxx}
or
{fabrik view=details...layout=yyy}

If you are calling your form/detailed view by URL you can append &layout=xxx to override the settings in your form definition.

If you want only to change CSS settings you can override the template's template_css.php
http://fabrikar.com/wiki/index.php/3.x_Form_Templates

To create your own templates clone a template (have a look at the contact_custom form template for displaying single elements)
clone a template (still the popup is missing in fabrik3 forum):
copy a template folder, rename it (no spaces), modify
http://fabrikar.com/wiki/index.php/Designing_form_templates
 
troester,
I'll have to look at this some more. I think I'm getting confused about the fact that there seems to be one template for two separate views.

For what I'm trying to do, the tabular view (what Joomla calls the "category") has to be styled one way. Then I need to style the specific record (what Joomla calls the "article") another way. These seem to be controlled from the same Fabrik template.

Sorry if my questions are weird. But as I'm looking at the Fabrik templates I'm just missing something!

I'm sure I'll figure this out eventually.

Thanks,
Matthew
 
Now I am confused;)
Normally fabrik has nothing to do with Joomla categories and articels.
Did you link fabrik lists to those Joomla core tables?

Back to the fabrik templates:
There are list templates (in components\com_fabrik\views\list\tmpl\) and form templates (in components\com_fabrik\views\form\tmpl\). Here you put your custom templates, too.
The form templates can be used for form view
(user editing a record) and for the detailed view (user viewing a record), you can use the same template for both views or define different ones.

For every list you can select a template in your backend list definition ("Layout" group; you can select different template for frontend and backend).
For every form you can select one form view template and one detailed view template (frontend) + one admin form view + one admin detailed view (backend) in the "Template" tab.

The template selections can be overriden in the content plugin or an URL with the "layout=xxx" or by selecting an other template in the menu item.
 
For a list, I guess what you assimilates with the Joomla! categories, there is one choice for template (but with different layouts) : you have to choose which one you want to use in the "Layout" section (option "Template").

For forms, you have two choices to make in the "Templates" tab : the layout for when you want to add/edit a record (what's called the "Form template") and the layout to display a detailed view of the record (after if has been added), what you assimilate with Joomla! articles. This one is called "Detailed view template".

By default, they are the same but you can choose a different one for each.

And in all cases you can create your own template pretty much the way you want. It might take some work but I think I always managed to get what I needed.
 
Greetings,
I've been looking into this a bit more. All the options are there, but I think the way they are set up in the Fabrik back-panel might be a bit confusing.

As I begin getting into templating, I wanted to capture my reactions to all this. Perhaps it can be helpful as you continue to work on Fabrik 3.

Here are the six general views needed in pretty much any site. I'll refer to these by number and letter below):

1. FORMS
A. Admin
B. Front-end

2. LISTS OF RECORDS
A. Admin
B. Front-end

3. SPECIFIC RECORDS
A. Admin
B. Front-end

Here are the current Fabrik template options (and the needs they meet as described above):

LISTS TAB

  • Template (2B)
  • Admin Template (2A)

FORM TAB
Group 1

  • Detailed View Template (3B)
  • Form Template (1B)

Group 2

  • Admin Details Template (3A)
  • Admin Form Template (1A)

Here's my description of where there might be confusion, with my humble suggestions for some fixes:

1. Placement of Template Options
Under the "Lists" tab, templates are under "Layout" in the central area. But in the "Forms" tab, templates are in the "template" tab on the right side of the screen. Could these be made more consistent?

2. Clearer Sectioning of Options in the Forms Tab
The Forms tab is handling four options that refer to rather different things:

  • Template options for specific records (3A and 3B)
  • Template options for forms (1A and 1B).

I understand that these need to all be under the "Forms" tab. But maybe it could be clearer to section them off like this:

  • Create a heading called "Detailed Record Views," and under that have "Front-End Details" and "Admin Details"
  • Create another heading called "Form Views," and under that have "Front-End Forms" and "Admin Forms."

3. Clear Up Some References in the Lists Tab
To help keep options here consistent with wording in the Forms tab, try this:

  • Reword the "Template" parameter to "Front-end template."
  • Have the tooltip for the "Front-end template" read like this: "The folder located in components/com_fabrik/views/list/tmpl/ that is used as a template when viewing lists from the front end."
  • Make the tooltip for the "Admin template" parameter read like this: "The folder located in components/com_fabrik/views/list/tmpl/ that is used as a template when viewing lists as an administrator. If none is chosen, the front-end template will be used."

4. Tweak Templates Tab Tooltips
The "Detailed view template" could read like this: "The folder located in components/com_fabrik/views/form/tmpl/ that is used as a template when viewing a specific record from the front end."

For the "Form template" parameter, the tooltip could read like this: "The folder located in components/com_fabrik/views/form/tmpl/ that is used as a template when viewing the entry form from the front end." If you take my suggestion to create headings as described above, this would be even more effective, since you already reference "front-end details view" in the current tooltips for "Admin details template" and "Admin form template"!

* * * *

Fabrik is pretty amazing! I hope my suggestions can be helpful. If there is a way I can contribute directly to documentation let me know.

If I have misunderstood any of the details, please let me know!

Thanks for your hard work,
Matthew
 
The Wiki is the place to contribute documentation.

If you feel really adventurous, you could install git. Grab copy of the code, then you can directly contribute suggested changes to things like tooltip language sending "pulll requests" from your copy. All we have to do is push a button in github to merge your suggested changes in to the master copy.

Please do continue to document your experience, and make suggestions. We may not immediately jump on all the suggestions, but some of them we will.

-- hugh
 
Hugh,
I'm documenting what I see as I experience it and figure it out, while it's fresh in my mind. After I get through the entire learning process, I'll contribute new notes to the Wiki that I hope can help others.

OK, next challenge...

Can anyone summarize the syntax for calling individual fields in the templates? I've tried following the details in the Wiki, but I either see nothing displayed, or I see literal text.

Thanks,
Matthew
 
take a look at the contacts_custom form template, it is a well commented template which describes how to do this.

I've commited some changes to the admin forms, which whilst not quiet what you were suggesting I think still go along with the general ideas you raised.

-ROb
 
Greetings Everyone,
I've been away from Fabrik for a little while developing in other areas, but now that 3.0 is out, I want to return again!

How much progress has been made on templating? Also, what kinds of improvements have been made on calling specific fields within a template?

Thanks,
Matthew
 
Although there has been many changes in the "look" of the lists (mainly) and forms, and the great new possibility to add an intro to groups, there are not too many changes as far as programming the templates.
The main difference with F2 is that now you can do an override for a form (or list - the new F3 for "tables") in the html folder of your main template like for the other elements of Joomla!.
This is useful when you wan tto apply the same changes to all the forms (or lists) that use the same template.
If you want something very specific for one form (or list), you still are better off cloning an existing template and write your code.
Regarding the CSS, it is handle now by a PHP file (template_css.php) in the template folder, which I find a little less practical : when working on CSS, I use a software that suggests/auto-fills a lot of properties for me, which does not happen with the new "CCS/PHP" file, because the properties are in a "echo" statement, so the IDE does not provide any suggestion/correction. Beware of the typos!
Also, I found the new "display:box" CSS3 function very difficult to use in custom template because it is not supported by IE and Opera.
It seems to work fine with "regular" forms but I can't get it working with more complex layouts.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top