I am displaying a list and set the tab field to an element called category (field element). I do not have an All tab. When the list first opens from the menu no tabs are active. Please see image one.
In components/com_fabrik/models/list.php the tabs entries are built. Function loadTabs (11984) at line number 12042 sets the row class for the active tab. It does this by comparing the current URI to the href built for the tab. However, this only works when the tabField=xxx is in the current URI. The tabField is not in the URI when the list view is called from a standard Fabrik list view menu. Therefore, with no tabField defined in the URI no tab is set active.
The existing code at line 12042 looks like this:
To solve this problem we can change the code to read:
With this change the tabs are set properly as shown in image_two.
In components/com_fabrik/models/list.php the tabs entries are built. Function loadTabs (11984) at line number 12042 sets the row class for the active tab. It does this by comparing the current URI to the href built for the tab. However, this only works when the tabField=xxx is in the current URI. The tabField is not in the URI when the list view is called from a standard Fabrik list view menu. Therefore, with no tabField defined in the URI no tab is set active.
The existing code at line 12042 looks like this:
Code:
$row->class = ($thisUri == $row->href) ? 'active' : '';
To solve this problem we can change the code to read:
Code:
$row->class = ($thisUri == $row->href || (strpos($thisUri, $tabsField) === false && $i == 0)) ? 'active' : '';
With this change the tabs are set properly as shown in image_two.