Product Updates
Joomla 5.2.3 Compatibility for JA Templates, Bug Fixes, and More

Hello,

I recently downloaded the JA Megafilter component. Everything works so far, thank you for that.

I use the component for the core function Joomla! Articles. I have built an address directory from Joomla! Articles, custom fields and overrides in [my template]/html/com_content/category and [my template]/html/com_content/article. For the category view, I use a 3-column layout that is based on bootstrap and tables. The tables are in a bootstrap grid and the output for each custom field comes in a separate table column (see screenshot/attachment).

I would now like to adapt the layout of the JA Megafilter results page to my own layout. Is there a way for JA Megafilter to change the fields selected in the component and similar to Joomla! spend individually?

I have already read the documentation at https://www.joomlart.com/documentation/joomla-component/ja-megafilter#override-layout, but I cannot find any information there.

Thank you for the answer in advance!

Chris

(sorry for the language, translated by Google)

Hi Chris,

It will require a bit heavy customization, let me check with our developer if it's possible to achieve that kind of layout.

Updated:

For the layout file, you can edit this one: plugins\jamegafilter\content\layouts\default\product-item.php

and JA Megafilter uses Dust.js, you will need to customize it to achieve that.

If you're not familiar with code, I suggest you to hire a developer to get it done for you.

Regards

Hello saguaros,
thanks for Your response.

I had already found the file, but the fields are output there via {? .key} in an array. I can use Bootstrap to control the width of the columns, but I cannot use them to output the fields individually. In Joomla I use:

<? php echo $ this-> item-> arbitrary_property_name ['my-field-name'] -> value; ?>

I therefore have the fields output via field names. Another option would of course be to use the field ID, but in any case I lack the syntax.

Any ideas or suggestions?

regards
Chris

    melodymedia

    Bootstrap can be handled easily but the thing here is that you must work with DustJS as I mentioned above.

    Hello saguaros,

    I hadn't looked at the recommended file openly because I was looking for a solution in PHP. In the JA Megafilter directory there is also no "Dust.JS" but only a "dust-helpers.min.js" and a "dust-helpers.js". If I see things correctly, the latter file is responsible for the output, and if I interpret the code correctly, it calls certain functions and queries certain parameters, which are then output via an array.

    
      / **
      * {@size}
      * Write the size of the target to the chunk
      * Falsy values ​​and true have size 0
      * Numbers are returned as-is
      * Arrays and strings have size equal to their length
      * Objects have size equal to the number of keys they contain
      * Dust bodies are evaluated and the length of the string is returned
      * Functions are evaluated and the length of their return value is evaluated
      * @param key find the size of this value or reference
      * /
      "size": function (chunk, context, bodies, params) {
        var key = params.key,
            value, k;
    
        key = context.resolve (params.key);
        if (! key || key === true) {
          value = 0;
        } else if (dust.isArray (key)) {
          value = key.length;
        } else if (! isNaN (parseFloat (key)) && isFinite (key)) {
          value = key;
        } else if (typeof key === "object") {
          value = 0;
          for (k in key) {
            if (key.hasOwnProperty (k)) {
              value ++;
            }
          }
        } else {
          value = (key + '') .length;
        }
        return chunk.write (value);
      }
    
    };
    
    for (var key in helpers) {
      dust.helpers [key] = helpers [key];
    }
    
    return dust;
    
    }));

    So it should actually also be possible with JavaScript to directly control the individual fields and have them output individually.

    Of course, I don't expect you to rewrite the file to my liking, but maybe your developers could at least give me a hint as to what the syntax should look like in order to print a single field. Then I would try the rest to assemble myself. If my wish exceeds your capacities, it is not too tragic, I will also find another solution, but if you could help me something, I would be very grateful because I always use such tasks to help me little to learn.

    Anyway:
    Good luck and thank you!

    Chris

    Hi Chris,

    Let me forward to our developer if he can help on this.

    Hi saguaros,

    I appreciate the effort.
    Looking forward to..

    regards

    Write a Reply...
    You need to Login to view replies.