Can I order by name - minifrontpage

I see that all order options are just by date, is there an option to order by name?
Resolved
The discussion has been resolved.
10 responses Add Yours
       
  • Replied by Vini1 on Saturday, February 08 2020, 12:36 AM · Hide· #1
    Another thing - It doesn't seem to be responsive. I get beautiful 3 columns on my desktop, but on my mobile it becomes a single column with a bloated thumbnail. Am I missing a setting?
    Thanks
  •  
  • Replied by admin on Saturday, February 08 2020, 11:57 PM · Hide· #2
    Hi,
    I see that all order options are just by date, is there an option to order by name?
    Did you mean alphabetical order? Unfortunately it's not possible at the moment
    Another thing - It doesn't seem to be responsive. I get beautiful 3 columns on my desktop, but on my mobile it becomes a single column with a bloated thumbnail. Am I missing a setting?
    Could you let me know the URL of your site so I can take a look?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by Vini1 on Monday, February 10 2020, 08:07 PM · Hide· #3
    I found the issue on mobile - in the default.php file, the following line appears:
    <div class="mfp-col-xs-12 mfp-col-sm-6 mfp-col-md-<?php echo 12/$default_num_column;?> mfp_default_item">

    So if I understand, for mobile/tablet it ignores the number of columns...
    For my site, i edited it manually so it will be 3 column wide for tablet/desktop and 2 column wide for mobile.

    It will be awesome if you can add a setting for number of columns on mobile / responsive, as I think I might not be the only one wanting different number of columns based on user device.
    Also, I dropped the h4 from the article link, as on mobily the text size was too large.

    I changed the orderering by title by going to the file MinifrontpageHelper.php and adding an option for 'a.title'.
    Also it seems that the ordering can only be changed by editing the file. I didn't find a setting for it.

    Finally, it seems that the thumbnail that is generated is low quality. Not sure how to improve it.

    If you can add the above features to the base extension, it will be awesome. I'm not a coder, so my fixes are hack, but I'm sure you will do it in a professional way.
    Thanks for your extension.
  •  
  • Replied by admin on Tuesday, February 11 2020, 12:40 AM · Hide· #4
    Hi Vin1, thank you for your valuable feedback ;)
    I found the issue on mobile - in the default.php file, the following line appears:
    It's a common responsive grid/column rules that means it will be 2 column wide in screen width > 48em (mostly tablet or phablet), 1 column wide in smartphone, and follow the column setting for devices width screen width > 75em (desktop, notebook). This rules generally will work most of cases, that's why I was asked for your website url that maybe have a different case.

    For my site, i edited it manually so it will be 3 column wide for tablet/desktop and 2 column wide for mobile.
    Did you edit the module's file directly? I wouldn't suggest you to as your modification will be overrided every time you install the new update. I'd suggest you to do template override instead. https://extensions.joomla.org/blog/item/overrides-the-easy-way-to-customise-almost-anything

    It will be awesome if you can add a setting for number of columns on mobile / responsive, as I think I might not be the only one wanting different number of columns based on user device.
    Adding too much settings will make it less simple / intuitive to start for new user so I'll leave it as it is. Additionally it also will increase the xml codebase that will potentially adding unnecessary extra loading time for module's backend

    Also, I dropped the h4 from the article link, as on mobily the text size was too large.
    Minifrontpage will follow your template typography style, so it is likely following your template's h4 rule. This is the reason why CSS Adjustment tab exist. You can add css overriding there without touching the physical files.

    I changed the orderering by title by going to the file MinifrontpageHelper.php and adding an option for 'a.title'.
    Also it seems that the ordering can only be changed by editing the file. I didn't find a setting for it.
    I haven't tested it so I can't comment about it but I'm glad it works for you.

    Finally, it seems that the thumbnail that is generated is low quality. Not sure how to improve it.
    To improve the thumbnail quality, simply increase the thumbnail size with the same ratio. Don't forget to delete all thumnail images under folder ../images/thumbnails/mod_minifrontpage after you have changed the setting, so it will generate the new ones.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by Vini1 on Wednesday, February 12 2020, 08:45 PM · Hide· #5
    Thanks for the information regarding layout override, I knew it existed but didn't have the chance to use it yet.
    Regarding the h4 setting, I will also look into the css option.

    about the ordering, it was actually pretty simple to add, as you have a robust codebase, so it was just adding another option. I think it is a good setting to have and shouldn't add clutter as you already have some options.

    My remaining issue is the thumbnail quality - it is not related to size, but to the jpeg setting probably. You can see here: https://www.pundak.co.il/role-playing-games/reviews it appears blocky and much worse than the article intro image which is roughly the same size.
    If you can point me to were I can set the quality, that will be great.
  •  
  • Replied by admin on Thursday, February 13 2020, 01:33 AM · Hide· #6
    it appears blocky and much worse than the article intro image which is roughly the same size.
    I see..

    I'll consider to add settings for image quality for the next release. In the meantime you can open the helper file, arround lines 229 - 241 you will see the quality variables. try to increase 70 to 100
    if($file_ext == 'png'){ 
    					$imagetype = IMAGETYPE_PNG;
    					$quality	= '7';
    					$file_ext = 'png';
    				}elseif($file_ext == 'gif'){ 
    					$imagetype = IMAGETYPE_PNG;
    					$quality	= '7';
    					$file_ext = 'png';
    				} else {
    					$imagetype = IMAGETYPE_JPEG;
    					$quality	= '70';
    					$file_ext = 'jpg';
    				}
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by Vini1 on Saturday, February 15 2020, 06:50 AM · Hide· #7
    I have tried the solution you suggested but it only gives a minor increase in quality. It seems the issue is the JImage quality itself (I think) or maybe the fact that the initial image is not that big.
    Is there an option to configure the minifrontpage to just use the image as is without generating thumbnails?
    Thanks
  •  
  • Replied by admin on Saturday, February 15 2020, 11:04 PM · Hide· #8
    I think it because the original file dimension is small and then JImage trying to create a bigger file. Try to change the thumbnail setting with your actual file size and then change the $size_multiplier in the helper file into 1.

    Is there an option to configure the minifrontpage to just use the image as is without generating thumbnails?
    You need to bypass the thumbnail creation process for that. Open the tmpl file with your php editor, for example, the template file for default theme : ../modules/mod_minifrontpage/tmpl/default.php

    at lines 57 comment out or delete this code :
    $thumb_img = MinifrontpageHelper::getThumbnail($item->id, $item->images,$thumb_folder,$show_default_thumb,$custom_default_thumb,$thumb_width,$thumb_height,$item->title,$item->introtext,$module->id);

    change with this :
    // Thumbnail is not exist
    $images = json_decode($item->images);
    // Find Article's Image
    if (!empty($images->image_intro) ) {
    $thumb_img = "<img src='".$images->image_intro."' />";
    } elseif (empty($images->image_intro) && !empty($images->image_fulltext) ) {
    $thumb_img = "<img src='".$images->image_fulltext."' />";
    } else {
    // Find first image in the article
    $html = $item->introtext;
    $html .= "alt='...' title='...' />";
    $pattern = '/<img[^>]+src[\\s=\'"]';
        $pattern .= '+([^"\'>\\s]+)/is';
    
        if ( preg_match($pattern, $html, $match) ) {
        $thumb_img = "<img src='".$match[1]."' />";
        } else {
        $thumb_img = "";
        }
        }


    then find all and replace this code (there are two existing)
    $thumb_img[0];

    change with
    $thumb_img;
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by Vini1 on Sunday, February 16 2020, 07:03 PM · Hide· #9
    Thanks for the code, used it and now all is great :)
    Would suggest to allow user to select if to generate thumbnails or not.
  •  
  •  
    Replied by admin on Sunday, February 16 2020, 11:29 PM · Hide· #10
    Ok glad you've managed to solve it ;)
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments