• Fabrik4.5.3 for J!5.3.0 and J!4.2+is out

    You must update from Fabrik4.5.1 if you are running Joomla!5.3.0

    See Announcements

Enhancement get rid of icon replacement name conversion

lcollong

FabriKant d'applications web
Hi there,

I use a lot a Fabrik's nice feature which is to replace a value by an icon on the list view. It allows compact size list by reducing colum witdh and make it easy to watch for some data. Specially for those columns such as "status" for example where it's easier to have a "green check" instead of "reservation accepted" or a red cross instead of "reservation refused".

However, using non english language in these labels makes me crazy to find the way Fabrik build the image's name for replacement file.

For example, I have a radio button set this way :

Capture.PNG


And this what Fabrik expects for the filename icons replacement values :
Code:
Array
(
    [0] => fabrik/non__pkg_extrieur
    [1] => presence_vehicule_non__pkg_extrieur
    [2] => non__pkg_extrieur
)
Array
(
    [0] => fabrik/oui___accs_foru
    [1] => presence_vehicule_oui___accs_foru
    [2] => oui___accs_foru
)

Almost impossible to find out. Specially for the seconde one !

So I made a quick'n dirty mod on the file components/com_fabrik/models/element.php in the replaceWithIcons() function around line 683 :
Code:
        if ($iconSubDir != '')
        {
            $iconSubDir = rtrim($iconSubDir, '/') . '/';
            $iconSubDir = ltrim($iconSubDir, '/');
            array_unshift($cleanDatas, $iconSubDir . $cleanData); //search subdir first
        }
// apchea       
        if (\FabrikHelperHTML::isDebug()) { echo "<pre>";print_r($cleanDatas);echo "</pre>";}
// /apchea       
        foreach ($cleanDatas as $cleanData)
        {

This simple line shows the different name Fabrik is looking for when you add the ?fabrikdebug=1 magic parameter at the end of the url (no matter wheter fabrik debug is allowed or not).

It will be better to dedicated a general parameter to this feature and to insert the files names in place of the actual values inside the list but as it is, it changed my life !

Possible enhancement ?

Regards,

Laurent
 
Shouldn't it better use the value as file name instead of the label?
I thought this was the case in the past (F3?)
 
Yes indeed. I thought the name construction scheme was starting by the value before trying to search for the label's equivalent. But it seems not. Far better to use the value. No question for me.
 

Members online

No members online now.
Back
Top