Upload
ahmadesty-tohir
View
216
Download
0
Embed Size (px)
Citation preview
8/18/2019 Creating a Custom List Template _ Fabrik
1/5
2/9/2016 Creating a custom list template | Fabrik
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/
Creating a custom list template
Home Forums Wiki Members
Home » Wiki » Lists » How do I ... Lists Adva nced
Page
Creating a custom list template
Contents
Location
Custom CSS in existing list templates
Copying an existing template
Creating a catalog like list view (div template)
Template overall structure
default.php
default_row.php
default_filter.php
default _headings.php
default_buttons.php
template_css.php
javascript.js
Layout Overrides - List row buttons
Example - don't show edit button
Location (top)
List templates are located in "/components/com_fabrik/views/list/tmpl/". Each template has its own folder.
Custom CSS in existing list templates (top)
http://fabrikar.com/forums/index.php?wiki/custom-styling-a-list/
Copying an existing template (top)
To create a new template we suggest that you copy an existing template folder and alter it to suit your needs.
Copy:
components/com_fabrik/views/list/tmpl/bootstrap/
to:
components/com_fabrik/views/list/tmpl/mytemplate/
The template used for a list is normally set in List / Details / Layout / Front-End or Admin Template, however
this can be overridden in the menu item that links to the List in which case you will need to edit the Menu
Log in
Main_Page Special: Page List
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#javascript-jshttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#template-css-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-row-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#custom-css-in-existing-list-templateshttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#locationhttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiContenthttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiContenthttp://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/forums/index.php?wiki/specialhttp://fabrikar.com/forums/index.php?wiki/special/pageshttp://fabrikar.com/http://fabrikar.com/forums/index.phphttp://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/forums/index.php?members/http://fabrikar.com/http://fabrikar.com/forums/index.php?wiki/special/pageshttp://fabrikar.com/forums/index.php?wiki/specialhttp://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/forums/index.php?login/http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/custom-styling-a-list/http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#example-don-t-show-edit-buttonhttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#layout-overrides-list-row-buttonshttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#javascript-jshttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#template-css-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-buttons-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-headings-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-filter-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-row-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#default-phphttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#template-overall-structurehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#creating-a-catalog-like-list-view-div-templatehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#copying-an-existing-templatehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#custom-css-in-existing-list-templateshttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#locationhttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiContenthttp://fabrikar.com/forums/index.php?wiki/how-do-i-lists-advanced/http://fabrikar.com/forums/index.php?wiki/lists/http://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/http://fabrikar.com/forums/index.php?misc/quick-navigation-menu&selected=wiki-558http://fabrikar.com/forums/index.php?members/http://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/forums/index.phphttp://fabrikar.com/http://fabrikar.com/
8/18/2019 Creating a Custom List Template _ Fabrik
2/5
2/9/2016 Creating a custom list template | Fabrik
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/
instead.
Creating a catalog like list view (div template) (top)
Use a copy of the "div" template (don't modify the div template itself, it will be overridden with the next update).
In default.php you can set these general parameters
In default_row.php single element's label and data can be addressed via
Template overall structure (top)
default.php (top)
Code (Text):
// The number of columns to split the list rows into
$columns = 1;
// Show the labels next to the data:
$this->showLabels = true;
// Show empty data
$this->showEmpty = false;
Code (Text):
$elementLabel = $this->groups->tablename___elementname; //replace 'tablename___
$elementData = $this->_row->data->tablename___elementname;
PHP:
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPage
8/18/2019 Creating a Custom List Template _ Fabrik
3/5
2/9/2016 Creating a custom list template | Fabrik
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/
default_row.php (top)
default_row.php is called repeatedly to render all of your lists rows.
To access a specific element you can do:
Each row has a standard set of properties:
8/18/2019 Creating a Custom List Template _ Fabrik
4/5
2/9/2016 Creating a custom list template | Fabrik
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/
Related data links are in this format:
Note a default_row.php file is obligatory if you want ajax lists to work correctly
default_filter.php (top)
Will render any filters you have.
An example custom default_filter.php template to render the search fields horizontally
default_headings.php (top)
Renders the lists headings.
default_buttons.php (top)
Renders the lists buttons, such as 'add', 'export to csv', 'import from csv'
template_css.php (top)
This is used to serve a css file whose css is specfic to the list being rendered.
ja vascript.js (top)
Contains any template specific JavaScript you may wish to use.
Layout Overrides - List row buttons (top)
You can override the markup that is used to generate the list's rows buttons (edit/delete/view etc).
List's have two styles for rendering their row buttons , these are defined by the lists' 'links->render buttons as'.
You can choose either to render as a dropdown or inline.
Each button and each 'render buttons as' option has a corresponding layout file, e.g. fabrik-delete-button.php,
stdClass Object (
[data] => stdClass Object (
[slug] => 64
[ __pk_val] => 64
[fabrik_select] =>
[fabrik_view_url] => /fabrik30x/index.php?option=com_fabrik&view=detail
[fabrik_edit_url] => /fabrik30x/index.php?option=com_fabrik&view=form&I
[fabrik_view] => [View link and icon]
[fabrik_edit] => [Edit link and icon]
[fabrik_actions] => of the application row buttons edit/view/delet
)
[cursor] => 1
[total] => 16
[id] => list_37_com_fabrik_37_row_64
[class] => fabrik_row oddRow0
)
PHP:
http://www.php.net/linkhttp://www.php.net/linkhttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPagehttp://fabrikar.com/forums/index.php?wiki/display-list-filter-horizontally/http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/#wikiPage
8/18/2019 Creating a Custom List Template _ Fabrik
5/5
2/9/2016 Creating a custom list template | Fabrik
http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/
XenCarta PRO © Jason Axelrod from 8WAYRUN.COM
(Like) (15931 View s)Last Modified: Dec 14, 2015 at 9:14 PM (Cached)
inline.php and dropdown.php, found in components/com_fabrik/layouts/listactions/
You can copy this layouts folder and the required layout file to your Joomla template folder's overrides folder,
e.g. ./templates/your_template/html/layouts/com_fabrik/listactions/dropdown.php, and this dropdown layout file
will be used to render the buttons.
Example - don't show edit button (top)
PHP: