How do I Override models/elements.php

xycofryx

Member
Joomla: 3.9.3
Fabrik: 3.9

Good day!

I wanted my dropdown range filter to be horizontal instead of vertical (Please Attachments)
index.php

Code:
        if ($type === 'list')
        {
            $return[] = '<div class="container">';
            $return[] = '<div class="row">';
            $return[] = '<div class="col-md-6 pl-0">';
            $return[] = JHTML::_('select.genericlist', $rows, $v . '[0]', $attributes, 'value', 'text', $def0, $element->name . '_filter_range_0');
            $return[] = '</div>';
            $return[] = '<div class="col-md-6 pl-0 pr-0">';
            $return[] = JHTML::_('select.genericlist', $rows, $v . '[1]', $attributes, 'value', 'text', $def1, $element->name . '_filter_range_1');
            $return[] = '</div>';
            $return[] = '</div>';
            $return[] = '</div>';
        }

I manage to do this by modifying models/element.php. Now I'm afraid that every time I update Fabrik I might loose the modifications I have made in the element.php. Is there such thing as overriding the element.php file without worrying that I might overwrite the modification that I have made?
 

Attachments

  • filter range.PNG
    filter range.PNG
    40.1 KB · Views: 230
No, there's no way to override a model.

If you feel like modifying that code to use a layout file to build the ranged markup, I'd be happy to merge that change into github.

There are several examples in the element model of using layouts.

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

Thank you.

Members online

Back
Top