Filter styling

Martooti

Member
In which file should I look to style to filters?
I would like to change "betweeen" and "and" words in range filter, and float some filters in 100% width.
Please point me in the right direction

Actualization:
I managed to change "between" and "and" text by editing fabrik component langage file and lines: COM_FABRIK_DATE_RANGE_AND="To"
COM_FABRIK_DATE_RANGE_BETWEEN="From"
I also edit the date.php file from plugins/fabrik_element/date
to put this labels in span with padding that there is a little space between them and input
in the lines 1495-1499
PHP:
$return[] = '<span style="padding:0 10px">' . FText::_('COM_FABRIK_DATE_RANGE_BETWEEN') . '</span>'
                        . $this->calendar($default[0], $v . '[0]', $this->getFilterHtmlId(0), $format, $calOpts);
                    $return[] = '<span style="padding:0 10px">' . FText::_('COM_FABRIK_DATE_RANGE_AND') . '</span>'
                        . $this->calendar($default[1], $v . '[1]', $this->getFilterHtmlId(1), $format, $calOpts);
                    $return[] = '</div>';

I am not a developer so for other people like me, I want to add that this "." between strings in the code are very important :D

I hope it will not destroy the filters functionality and someone else can use it without any problem

Now I am trying to figure out how to edit checkbox filter, but this one seems more difficult. Why it give to every checkbox span12 class and how to change that?
fabrikgrid_checkbox span12

I did change in the element options: filter class to span2 but still it gives span 12 o_O
 
If you need to override language file entries, don't do it by editing our files directly. Use J!'s language override feature.

https://docs.joomla.org/J3.x:Language_Overrides_in_Joomla

... which won't get overwritten the next time you do an update of Fabrik.

For the filter box styling ... that's something we'll very probably soon do as J! layouts, which are mini-templates that can be overridden. Meanwhile, I'm making a few changes in the code to wrap those ranges up in a div and some spans, just because I've had a few people want to style those recently, and it's hard to do because of the lack of containers. I'll commit that some time in the next few days, then you'll be able to get rid of the changes you made to the date PHP (because again, you are going to ose that the next time you update).

I'm pretty sure the span12 is coming from some dynamic code which is handling the responsiveness, not sure if theres much you can do about that. I'll see what I can find.

-- hugh
 
Hi
I've altered the date filter code to use JLayouts - so they should now be overridable as of this commit:
https://github.com/Fabrik/fabrik/commit/55c551f855ad1e5833f5d5efba63ab8d95148e2d

I've also started on the docs for this:
http://fabrikar.com/forums/index.php?wiki/jlayouts/

So that being said for the checkbox rendering you will need to create a layout override.

- Copy plugins/fabrik_element/date/layouts/fabrik-element-date-list-filter-checkbox.php
- Paste it in /layouts
Edit it and paste this in:

PHP:
<?php
defined('JPATH_BASE') or die;
 
$d    = $displayData;
 
echo implode("\n", FabrikHelperHTML::grid($d->values, $d->labels, $d->default, $d->name,
'checkbox', false, 2, array('input' => array('fabrik_filter'))));
note the only thing that has changed here is the that we replaced '1' with '2' - which tells the grid helper to render in 2 columns
 
Ah, that's why my changes, referenced in my last post, blew up this morning's Pull with a merge conflict. :)

So yeah, ignore everything I said, except for the bit about we'd probably soon make the filter stuff as a layout. :)

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

Thank you.

Members online

Back
Top