Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • mazhar shah Friend
    #1073061

    Some of my ‘filters are too long. There are + and – signs but they are ALL open by default which makes the page very long. How can I have them closed by default. Or better still, is it possible to have ‘some open(+)’ and ‘some closed(-)’ by default?

    I am only FILTERING JOOMLA PAGES using joomla fields. Ideally I would like the ‘categories’ filter to be open and some selected joomla field filters to be closed and some open by default when the Megafilter component is first accessed.

    • This topic was modified 6 years, 5 months ago by  mazhar shah.
    • This topic was modified 6 years, 5 months ago by  mazhar shah.
    • This topic was modified 6 years, 5 months ago by  mazhar shah.
    • This topic was modified 6 years, 4 months ago by  mazhar shah.
    Luna Garden Moderator
    #1073507

    Hi,

    Try this solutions in this link: https://www.joomlart.com/forums/topic/ja-megafilter-collapsed-from-start/#post-1039482 and tell me the results.

    mazhar shah Friend
    #1073710
    This reply has been marked as private.
    Mo0nlight Moderator
    #1073849

    Hi.

    I edited file:

    components/com_jamegafilter/assets/js/script.js

    Add the code:

     else {
            // first load.
            jQuery('dt.filter-options-title').each(function(i){
                jQuery(this).addClass('collapsed');
                jQuery(this).next().slideUp( function() {
                    recalc_sticky(jQuery('.sidebar-main'));
                });
            });
        }

    at line 64

    And deleted the previous code.

    mazhar shah Friend
    #1074021

    Thank you so much. Just wondering, as each field has its own id, is it possible to target these individually so that some are open and others closed?

    Mo0nlight Moderator
    #1074386

    Hi.

    You could try this.

    jQuery('dt.filter-options-title').each(function(i){
        if (i == [number of the title you want to collapse ex : 1,2,3,4....]) {
            .........
        }

    or something like this.

    jQuery('dt.filter-options-title').each(function(i){
        if (jQuery(this).attr('id') == '[The individually ID]') {
            .........
        }
    mazhar shah Friend
    #1074595

    I tried both, but neither worked for me. For example I want the field with ID 2 closed

    else {
            // first load.
            jQuery('dt.filter-options-title').each(function(i){
            if (jQuery(this).attr('id') == '[2]') { 
                jQuery(this).addClass('collapsed');
                jQuery(this).next().slideUp( function() {
                    recalc_sticky(jQuery('.sidebar-main'));
                });    }
            });
    
        }
    Mo0nlight Moderator
    #1075213

    Hi.

    You should try the first one.

    I edited the file you could try to using that for reference

            jQuery('dt.filter-options-title').each(function(i){
                if (i == 0 || i == 1 || i == 2) {
                    jQuery(this).addClass('collapsed');
                    jQuery(this).next().slideUp( function() {
                        recalc_sticky(jQuery('.sidebar-main'));
                    });    
                }
            });

    It will only close the three first options.

    mazhar shah Friend
    #1076987

    Hi Thank you It does work. HOWEVER the ‘field id’ numbers do not work. The numbers 0,1,2 etc in (i == 0 || i == 1 || i == 2) are only linked to the ORDER in which the custom fields are listed in the ‘Filter Config’ of the component. In other words, 0 is the categories and if I change the order of the Custom Fields in the Filter Config, then the corresponding fields in the front end are shown as open or closed depending on the order.

    This is fine and works. HOWEVER, I have 3 sections on my site, each using the Filter component independently and some have common custom fields too. I can juggle the fields in each ‘Filter Config’ for each section…(just about), but some fields are common to 2 sections and others need to be in different order? Juggling the fields is a little tedious and may cause a problem if I decide to create a totally new section in the future.

    1. Is there a way the ‘numbers’ can target individual custom field ‘id’s’ rather than the ‘order’ in which the fields are listed?
    2. If 1 is not possible, then rather than adding code to the default js file in components/com_jamegafilter/assets/js/script.js, is there a way to have a separate js file for each new component custom layout? This way, I can duplicate the layout and js file for each section having its own custom layout and I wont have to juggle the field order?

    3. The only reason I wanted to close some of the fields is because in the multi-select, I have over 20 options and the page becomes far too long if the are all open at the beginning. THE IDEAL SOLUTION would be to have about 5 select items showing and an option to show the rest. Please see the attached image of the way LinkedIn does it. I know its not a feature right now, but is there any way to achieve this? or would you consider adding it sometime in the future? It seems a much cleaner and tidier solution to the one at present where there is no control at all and the layout looks rather long and messy when there are so many multi-select option.

    I THINK THIS IS ONLY NEEDED ON THE MULTI-SELECT OPTIONS (not on the drop downs or anywhere else)

    (whilst the attached image doesnt show it, this LinkedIn page is also a filter which works just like JA Megafilter. And when you click show more all options are shown)

    • This reply was modified 6 years, 4 months ago by  mazhar shah.
    • This reply was modified 6 years, 4 months ago by  mazhar shah.
    • This reply was modified 6 years, 4 months ago by  mazhar shah.

    1. linkedin-filter-example
    2. linkedin-filter-example-2-1
    Mr.Cat Moderator
    #1077569

    @mazhar,

    1 .You can follow these steps to get fields you want.

    Download the attachment below and extract it.

    Copy "filter" folder has been extracted to

    /plugins/jamegafilter/content/

    Then you can use this code to get the collapse button

    jQuery("dt[field='attr.ct3.value']")

    "ct3" means customfield with id = 3

    3 .That is good idea. Thought it’s a better solution for long filter list. We’ll consider to bring it into next release.Thanks for your sugesstion.

    Regards

    • This reply was modified 6 years, 4 months ago by  Mr.Cat.
    • This reply was modified 6 years, 4 months ago by  Mr.Cat.

    1. filter.zip

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    kastoro Friend
    #1077668

    3 .That is good idea. Thought it’s a better solution for long filter list. We’ll consider to bring it into next release.Thanks for your sugesstion.

    I can agree with that. I have also lots of long lists box. It would be also a good thing, if we can choose between default open or close filters, the closed filters could be similar to the mobile view. It would be good for the horizontal layout also. The reason is: filters sometimes not a default thing on homepage only a good possibilites. If somebody interests for it, he can open the filter, but if he desn’t interest, he can browse results without lots of open filters above.

    • This reply was modified 6 years, 4 months ago by  kastoro.
    mazhar shah Friend
    #1077714

    Thank you so much Mr. Cat. It would be tremendous if you could add it in your next update. I can now plan my earlier options for the component which I had put aside simply because of this problem Now I can plan to implement them again in the future. Thank you again and I will wait eagerly for the next release 🙂

    mazhar shah Friend
    #1086521

    Mr.Cat wrote:

    3 .That is good idea. Thought it’s a better solution for long filter list. We’ll consider to bring it into next release.Thanks for your sugestion.

    Hi Mr Cat. I have had two complaints form my customers for the length of the filters. Any chance oif finding when the modification for this filter module is planned?

    Saguaros Moderator
    #1086725

    Hi,

    Unfortunately, this feature is not available now, pls stay tuned.

    Regards

    mazhar shah Friend
    #1086732

    Thank you Saguaros. I know its not available right now, but Mr Cat said you may consider it for the next release – which was a while ago. It’s a vital feature which most other filters have. I was hoping you may let me know if it is being considered and what progress has been made. It would really help in my planing.

    p.s. The feature in question is the one Mr.Cat mentioned in 3 above and shown in the attached images. It is where you have a long list of options and only a few are shown and the rest expandable. See images above

    • This reply was modified 6 years, 3 months ago by  mazhar shah.
Viewing 15 posts - 1 through 15 (of 17 total)

This topic contains 16 replies, has 6 voices, and was last updated by  mazhar shah 6 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum