• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

DIV template issue with classes from "use as row class" (solved)

monkframes

Member
To whom it may concern:

If you set "Use as row class" to "Yes" in "List view settings" -> "List settings" of an element, and you are using the list DIV template, the classes shown in the list are all the same in all of the rows (actually the ones corresponding to the last element).

I solved that diving in the code and making a very simple change in the file /components/com_fabrik/views/list/tmpl/div/default.php (lines 83-91):

Original code:
Code:
    <?php

    $items = array();
    foreach ($group as $this->_row) :
        $items[] = $this->loadTemplate('row');
    endforeach;
    $class = 'fabrik_row well row-striped ' . $this->_row->class;
    echo FabrikHelperHTML::bootstrapGrid($items, $columns, $class, true, $this->_row->id);
    ?>

My change:
Code:
    <?php

    foreach ($group as $this->_row) :
        $items = array();
        $items[] = $this->loadTemplate('row');
        $class = 'fabrik_row well row-striped ' . $this->_row->class;
        echo FabrikHelperHTML::bootstrapGrid($items, $columns, $class, true, $this->_row->id);
    endforeach;
    ?>

I hope this may be useful for anyone else.
 
Have you tested that with grouping enabled on the list? I can't offhand remember if the div template really supports grouping or not, but needs to be tested.

-- hugh
 
I have tested both, grouping and not grouping, and now it works perfectly.

I have been using the old DIV template on my site for a long time, but when I updated it to the last 3.8 version from GitHub I founded this odd behaviour.
 
Hmm, that doesn't really fix it. It kinda half way does, as it'll apply the element class, but it completely breaks the grid layout.

I'll have a hack it fixing it properly later today or over the weekend.

-- hugh
 
Hi Hugh,

I?m afraid it?s not working. I copy a pseudo-code from firebug so you will know what I mean:

1. divs id?s are all the same, the last one ("list_20_com_fabrik_20_row_8371")
2. The new div with the elements classes just add the class of 1 element (Madrid#), not all (estado# Madrid#).
3. Classes "oddRow0" & "oddRow1" are missing (I don?t know if that classes have any sense in this template)

The HTML code is:
Code:
<div class="fabrikList" id="list_20_com_fabrik_20">
    <div class="fabrik_groupdata">
        <div class="groupDataMsg">
            [...]
        <div class="row-fluid">
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8371">
                <div class="Madrid2">
                    [...]
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8371">
                <div class="Madrid1">
                    [...]
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8371">
                <div class="Madrid3">
                    [...]

When I guess it should be:
Code:
<div class="fabrikList" id="list_20_com_fabrik_20">
    <div class="fabrik_groupdata">
        <div class="groupDataMsg">
            [...]
        <div class="row-fluid">
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8372">
                <div class="oddRow0 estado1 Madrid2">
                    [...]
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8379">
                <div class="oddRow1 estado0 Madrid1">
                    [...]
            <div class="fabrik_row well row-striped span4" id="list_20_com_fabrik_20_row_8371">
                <div class="oddRow0 estado4 Madrid3">
                    [...]

Or even:
Code:
<div class="fabrikList" id="list_20_com_fabrik_20">
    <div class="fabrik_groupdata">
        <div class="groupDataMsg">
            [...]
        <div class="row-fluid">
            <div class="fabrik_row well row-striped oddRow0 estado1 Madrid2 span4" id="list_20_com_fabrik_20_row_8372">
                [...]
            <div class="fabrik_row well row-striped oddRow1 estado0 Madrid1 span4" id="list_20_com_fabrik_20_row_8379">
                [...]
            <div class="fabrik_row well row-striped oddRow0 estado4 Madrid3 span4" id="list_20_com_fabrik_20_row_8371">
                [...]

I hope this helps, thanks in advance.
 
Last edited:
OK, tx, I'll take another look. Hadn't thought about the issue of multiple row classes.

And no, the row striping makes no sense in this template, I'll probably remove it entirely.

-- hugh
 
Nope. It's fairly low down the priority list, as it's only being reported by one Community user, and I obviously have to prioritize issues raised by paying subscribers, and those which affect multiple users.

I'll try and find some time this week.

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

Thank you.

Members online

Back
Top