• Resolved antonstepichev

    (@antonstepichev)


    Hello Sayontan and thank you for your plugin!
    Is there a way for Random Justified Gallery to assign different Minimum Tile height for different pages? May be some hidden shortcode parameter?
    Thank you in advance and best regards!
    Anton.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    Sorry, that cannot be done. What would be the use case for this? As in, why would you want this to be different from page to page?

    Thread Starter antonstepichev

    (@antonstepichev)

    I have two different types of galleries
    1 – Illustrations for articles – example: http://www.backtomusic.ru/photo/lens/xenar
    2 – Photography page – example: http://www.backtomusic.ru/photo/gallery/look?attachment_category=smena-v4

    So in my photography page the value “300” is OK, but in articles it would be better 260-280 otherwise the gallery is too large. I had to switch it off.

    Plugin Author Sayontan Sinha

    (@sayontan)

    What happens if you set a minimum height of 250px? In your photography page there will still be images that are quite large, isn’t it?

    Thread Starter antonstepichev

    (@antonstepichev)

    Yes, but most of vertical images become too small, i do not like it that way.

    Plugin Author Sayontan Sinha

    (@sayontan)

    I see. Well, at this point I will tag this as a feature request. I don’t think it is very difficult to implement, but it is quite lengthy to provide via the support forum. I will try to accommodate this in one of the next two versions.

    In the meanwhile, have you considered using the Masonry layout for your illustrations? In the masonry layout you can control the width and the number of columns, so it might be a better fit for smaller images.

    Thread Starter antonstepichev

    (@antonstepichev)

    I tried the Masonry, but I did not like too much difference in the height of the columns.

    Sayontan, thanks for your kind response! If the feature will be in the next version, it would be great.

    Best regards and thank you once again,
    Anton.

    Plugin Author Sayontan Sinha

    (@sayontan)

    OK – last attempt 🙂

    Have you tried the mosaic layout with a trigger width setting of 230px or 250px? Your page content seems to be 960px wide, so the mosaic layout will try not to fit more than 3 or 4 images in a row. There is a chance that you might get some small images, but hopefully that is something you can work with if your originals are not very big.

    Thread Starter antonstepichev

    (@antonstepichev)

    I tried it right now. With different trigger values the Mosaic either make too big pairs of images in three rows or three images in two rows where the images are too different in size. It’s not good for articles, where each illustration should look roughly equivalent.
    Seems, the Random is only suitable one.

    Thread Starter antonstepichev

    (@antonstepichev)

    Hello Sayontan!
    I’m trying to optimize my galleries and in the process I had another question. I do not know if it’s worth starting a new topic, tell me if it’s necessary.
    The question of the size of the files. To make the page load faster, you need to make a gallery of rather small size files “‘slide_size =’ large ‘” or even middle, but as far as I could figure out, the Lightbox uses files of the same size as the Random gallery and because of this Lightbox photos are not big enough (640 pixels). This can be corrected by making “‘slide_size =’ full ‘”, but in this case the page with the big gallery loads too slowly.
    Question: Is it possible to specify separately an large or middle size for Random galleries, and a full size for a Lightbox?

    Thank you in advance,
    Anton.

    Plugin Author Sayontan Sinha

    (@sayontan)

    The “slide_size” parameter is for slideshows, not the lightboxes or layouts. For each layout you can control 3 sizes: “thumb_size”, “tile_size” and “main_size”. The “thumb_size” parameter is used for the thumbnail in the “square” or “circle” layouts. The “main_size” is what is shown in a lightbox. The “tile_size” is what you can use for optimization – if specified, it is used for the “random”, “mosaic” and “masonry” layouts. You can have a tile size somewhere in the middle to make things quicker.

    Each of these can be passed as a shortcode parameter.

    Thread Starter antonstepichev

    (@antonstepichev)

    Hello Sayontan and thanks for you kind reply!
    The situation is:
    1 – shortcode: “style=’random’ slide_size=’full'”. In this case in the Random gallery when I mouse over a picture I see a link to a full version of the picture. When I click the picture it opens in fullframe.
    2 – shortcode: “style=’random’ slide_size=’medium’ (or slide_size=’large’)”. In this case in the Random gallery when I mouse over a picture I see a link to a “320px” or “640px”version of the picture. When I click the picture, it opens in a small 640px or 320px window.
    3 – shortcode: “style=’random’ tile_size=’large’ (or tile_size=’medium’, or tile_size=’full’) main_size=’full’ (or main_size=’medium’, or (or main_size=’full’))”. In any of nine combinations in the Random gallery when I mouse over a picture I see a link to a “640px” version of the picture. When I click the picture, it opens in a small 640px window.

    So it seems that shortcodes “tile_size” and “main_size” do not work and “slide_size” does the job for both – gallery and lightbox. Any idea?

    Plugin Author Sayontan Sinha

    (@sayontan)

    Sorry, I had forgotten that you are using a native WP gallery. While the tile_size code has not been included so far for native galleries, it is fairly easy to add if you want to try:

    1. Go to the file wp-content/plugins/photonic/extensions/Photonic_Native_Processor.php.
    2. You will see this in line 119:
      $main_size = $shortcode_attr['slide_size'];
      After this line add:
      $tile_size = empty($shortcode_attr['tile_size']) ? $shortcode_attr['tile_size'] : $main_size;
    3. Then, a few lines later, you will see:
      $sources[$id] = wp_get_attachment_image_src($id, $main_size, false);
      After the above line add:
      $tiles[$id] = wp_get_attachment_image_src($id, $tile_size, false);
    4. Next, a few more lines below you will see:
      $photo_object['tile_image'] = $sources[$id][0];
      Change it to:
      $photo_object['tile_image'] = $tiles[$id][0];

    I will include this in the next version.

    Thread Starter antonstepichev

    (@antonstepichev)

    I kindly add everything as you wrote, but nothing has changed.
    So i made a test page, see code below:

    [gallery style='random' tile_size='large' slide_size='full' ids="11094,11175,11174"]
    [gallery style='random' tile_size='large' main_size='full' ids="11094,11175,11174"]
    [gallery style='random' tile_size='medium' slide_size='full' ids="11094,11175,11174"]

    here is the page address: http://www.backtomusic.ru/photonic-test
    here is the corrected php: http://www.backtomusic.ru/wp-content/uploads/2018/08/Photonic_Native_Processor.php_-1.zip

    As you can see on the test page, both the tile_size and the main_size sortcodes still do not work. Seems I did something wrong, but I can’t figure out what.

    Plugin Author Sayontan Sinha

    (@sayontan)

    I made a “rookie mistake”. In the first change it should be:

    $tile_size = !empty($shortcode_attr['tile_size']) ? $shortcode_attr['tile_size'] : $main_size;

    Thread Starter antonstepichev

    (@antonstepichev)

    Yes!! Everything works as it should be now.
    Thank you very much!

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Different “Minimum Tile height” for different pages’ is closed to new replies.