• Resolved coquimoran

    (@coquimoran)


    I’m generating dinamically the shortcode for nextgen gallery to show in each of the pages of my website. In the shortcode I’m generating, I’m specifically seting the order in which I would like to see the images, however the plugin does not respect the order I set in the shortcode, and I guess is applying the configuration from “Other options” sort default field.

    An example of the shortcode would be [ngg_images image_ids=’4050,4047,4040,4041′ display_type=’photocrati-nextgen_basic_thumbnails’]

    As in each page the sorting I would like to apply might be different, I was wondering if there is a way for the plugin to disable the default sorting option, and respect the order in which the images are invoked in the code.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Imagely

    (@imagely)

    Hi @coquimoran,

    The shortcode sorting order will get ignored in case that you are already using a specific global sorting order within “NextGen Gallery -> Other Options -> Image Options -> What’s the default sorting method?

    You’d have to set it to “Custom” for the shortcode parameter to apply.
    By the way, you seem to use a deprecated parameter for the sorting. You’ll need that replaced with sort_order=”” for it to correctly apply.

    Example:

    [ngg_images image_ids="4050,4047,4040,4041" sort_order="photocrati-nextgen_basic_thumbnails"]

    • This reply was modified 3 years, 1 month ago by Imagely.
    • This reply was modified 3 years, 1 month ago by Imagely.
    Thread Starter coquimoran

    (@coquimoran)

    Thanks for the response.

    I had already set the “NextGen Gallery -> Other Options -> Image Options” sorting method to “Custom” but it’s not respecting the order i’m providing with the image_ids.

    I wrongly wrote in the example in my previous message the “sort_order” in the shortcode, but in reallity what i generate is “display_type”. The correct shortcode I’m generating is…

    [ngg_images image_ids=”4050,4047,4040,4041″ display_type=”photocrati-nextgen_basic_thumbnails”]

    Plugin Contributor Imagely

    (@imagely)

    Hi @coquimoran,

    Could you please try to use “sort_order” within your shortcode to indicate the sequence of the images that you’d like to display and idsfor the gallery ID from where it needs to load the images? Apparently you are using some parameters that are either old or deprecated for the shortcode.

    You’d need a shortcode construction that looks like the one from below:

    [ngg_images ids="1" image_ids="4050,4047,4040,4041" sort_order="photocrati-nextgen_basic_thumbnails"]

    • This reply was modified 3 years, 1 month ago by Imagely.
    • This reply was modified 3 years, 1 month ago by Imagely.
    Thread Starter coquimoran

    (@coquimoran)

    Hi Imagely,

    Many thanks for your support!. Unfortunately, either I dind’t understand correctly your instructions, or if I did, it didn’t work out.

    To me, there is a misalignment between your explanation and the shortcode you worte. Anyway, I tried the shortcode construction you suggested …

    [ngg_images ids="270" image_ids="4050,4047,4040,4041" sort_order="photocrati-nextgen_basic_thumbnails"]

    …but resulted in a message “We cannot display this gallery”

    Then I also tried the shortcode I can deduce from yoru explanation, resulting in the following shortcode…

    [ngg_images ids="270" sort_order="4050,4047,4040,4041" display_type="photocrati-nextgen_basic_thumbnails"]

    … this also resulted in a “We cannot diplay this gallery” message.

    And finally I also tried…

    [ngg_images ids="270" image_ids="4050,4047,4040,4041" sort_order="4050,4047,4040,4041" display_type="photocrati-nextgen_basic_thumbnails"]

    … wìth this shortcode I’m able to show the images selected, but they are not ordered in the provided order set on the “sort_order” parameter.

    Could you please elaborate further your comment regarding the either old or deprecated parameters? After lookign at the documentation, I cannot locate which is the parameter that is old or deprecated from my initial shortcode…

    [ngg_images image_ids=”4050,4047,4040,4041″ display_type=”photocrati-nextgen_basic_thumbnails”]

    Many thanks for your help!

    • This reply was modified 3 years, 1 month ago by coquimoran.
    Thread Starter coquimoran

    (@coquimoran)

    After reviewing extensevely the documentation, I have also tried the most modern shortcode structure …

    [ngg src="galleries" ids="270" entity_ids="4045,4050,4047,4040" display="basic_thumbnail"]

    … but without success. The images are not sorted acording to the specified order.

    Plugin Contributor Imagely

    (@imagely)

    Hey @coquimoran,

    Sure. I will be happy to elaborate more on the old and deprecated shortcode’s parameters. So historically, I believe that we have changed the name of the parameters around 2 times mostly for the display type parameter’s name and values and also for the gallery ID that’s now just “ids” instead “image_ids” ( I believe ). To make sure that you are using a correct set of parameters for your shortcode, you can insert a NextGen Gallery block using the default WordPress editor then edit that block as HTML or switch the editor to Code Mode to see the resulted shortcode and its parameters.

    I am very sorry for unintentionally misleading you regarding using a wrong parameter within the shortcode for the display type parameter. Let’s try using the below shortcode lastly to see if that changes anything or not:

    [ngg src="galleries" ids="270" sort_order="4045,4050,4047,4040" display="basic_thumbnail"]

    If it doesn’t, please feel free to reach us directly at https://www.imagely.com/report-bug/ mentioning this thread and we’ll be happy to have a look at this case.

    • This reply was modified 3 years, 1 month ago by Imagely.
    Thread Starter coquimoran

    (@coquimoran)

    Tried your shortcode, but the order is not respected, and it is showing all the images within the gallery id 270.

    I’ve submitted a bug report. Hope we can find the issue.

    Thanks

    Thread Starter coquimoran

    (@coquimoran)

    I finally got it working!!!

    It seems that instead of the “sort_order” parameter you have to use the “sortorder” one, and besides that, I also found that with the ids=”270″, the plugin is including all the images within that gallery id, and then you have to exclude the images you don’t want to show.

    Just if anyone else at some time has the same problem, the working shortcode structure is…

    [ngg src="galleries" ids="270" sortorder="4045,4050,4047,4040" exclude="4041,4042,4043,4044,4046,4048,4049" display="basic_thumbnail"]

    • This reply was modified 3 years, 1 month ago by coquimoran.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Order of image_ids in shortcode’ is closed to new replies.