Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1303365

    Hello,
    I would like to create a gallery that has the possibility that as soon as I click on an image, I am redirected to the page on which this image is embedded. For the gallery I use the Media Library Assistant Plugin. This works great, but now I need the Parent_ID, that means on which page which image is displayed. Is there a way to automatically fill the “Uploaded to” field?
    I could fill this in manually, but unfortunately I have over 5000 images embedded on my site, so this would be very time wasting.
    I have already contacted the Media Library Assistant support, but unfortunately the plugin does not offer this.
    Can I implement this with Enfold? Is there another plugin or a code snippet that I can insert? important to say is that almost all my pictures are included in masonry galleries.

    I would be very grateful for your help!

    #1303611

    Hey Peter,

    Thank you for the inquiry.

    Are you trying to redirect the gallery item to the actual attachment page? The wp_get_attachment_link function might help.

    // https://developer.wordpress.org/reference/functions/wp_get_attachment_link/

    You may need to modify the enfold/config-templatebuilder/avia-shortcodes/gallery/gallery.php file to apply the attachment link.

    Best regards,
    Ismael

    #1304596

    Hi Ismael,
    thanks for your answer!

    Yes, I would like to redirect the image to the page where it is embedded.
    I guess the wp_get_attachment_link function is good for me, but unfortunately I don’t know where exactly I have to embed it.
    I have already tried modify the enfold/config-templatebuilder/avia-shortcodes/gallery/gallery.php file, but I can’t find the right place for embedding this code.
    Can you please help me?

    Best regards

    #1305220

    Hi,

    Thank you for the update.

    Since you are using a plugin to create or show the gallery, modifying the theme’s gallery.php file will not help. You have to contact the plugin authors and ask them where the wp_get_attachment_link function should be added.

    Best regards,
    Ismael

    #1305776

    Hi Ismael,
    I contacted the plugin author again and asked him about the wp_get_attachment_link function. This was his answer:

      “Thanks for taking the time to contact the Enfold support team and for posting their reply. It looks like they have not understood your question/requirements.

      The wp_get_attachment_link() function returns a hyperlink that contains the item thumbnail image and links to the “Media Page” for the item. MLA uses it for the link=page parameter. This function has nothing at all to do with finding the items that participate in a masonry gallery and attaching them to their parent post/page.

      What you want is a solution that:
      Finds all the masonry gallery shortcodes in the site,
      Executes each shortcode to find the items it returns, and
      Attaches each item to the post/page containing the shortcode.
      The above will work for galleries that are dynamic, e.g., display items having a particular taxonomy term. If the gallery items are fixed, i.e., the item ID values are stored somewhere the solution would be to find the ID values and then attach the items.

      Either solution requires more information about the Enfold masonry gallery than I have. I would be happy to work with the Enfold people if they want to contact me at my web site.
      I regret the confusion but I will help if I can. ”

    My Support Ticket

    I extra paid for your support again, so I would really appreciate if you could help me!
    David, the plugin author, is a very nice man and would like to solve this problem, but he would need your help because of the masonry gallery.
    So it would be very very helpful if you could contact David to help him with this.
    I think I am not the only one for whom this solution would be very helpful!
    This is his website: http://davidlingren.com/

    Thank you in advance!!
    Best regards

    • This reply was modified 3 years, 6 months ago by pete4u.
    #1306128

    Hi,

    I am redirected to the page on which this image is embedded.

    Would you mind giving us a link to one of these pages?

    Finds all the masonry gallery shortcodes in the site,

    We do not understand why the plugin author mentioned the masonry gallery element. As we mentioned above, the gallery in the portfolio-test page is not from the theme. It is a different gallery generated by a plugin and it is definitely not a masonry gallery element.

    This is the markup of a gallery in the portfolio-test page.

    // https://pastebin.com/sa2n9uYK

    Best regards,
    Ismael

    #1306157

    Hi Ismael,
    I think you misunderstand me. Yes I have created a gallery with the plugin Media library assisant. However, I would like that as soon as you click on an image of this gallery, you are redirected to the page where this image is embedded. E.g. click on a picture of the pool and you will redirected to the post in which this pool image is shown.
    In my top gallery on the portfolio-test page you can see that if you click on the iceberg, you will be redirected to the blog post “CRUISE DRIVE SUNFINSTERY ANTARCTIC”.

    The exact problem now is:
    the plugin only finds the parent-id from the post images, but not from the other images on my website.
    These images are all stored in masonry galleries, the plugin author is not familiar with this masonry galleries and does not know where the id of these masonrys is stored. So this is why he needs your help!
    I could manually assign each image to a post, but since i am using 5000 images on my website, that would be very cumbersome ..
    We would only need the information how and where the item ids of the masonry galleries are stored, then David could customize his plugin and add the right function!
    I hope you understand what my problem is ..

    Best regards

    #1306299

    Hi,

    These images are all stored in masonry galleries,

    How do you store the images in the masonry galleries? Where can we see the masonry galleries? This just makes this all the more confusing. In the portfolio-test page above, we only see the plugin gallery, but no masonry gallery, so we cannot understand the connection between the plugin’s gallery and the masonry galleries.

    If you want to extract the ids of the images from a masonry element, you can parse the shortcode and get the value of th ids parameter. This is an example of masonry shortcode.

    
    [av_masonry_gallery ids='357,356,355,354,353' caption_elements='title excerpt' caption_styling='' caption_display='always' size='flex' orientation='' gap='large' columns='flexible' av-medium-columns='' av-small-columns='' av-mini-columns='' items='24' paginate='none' color='' custom_bg='' overlay_fx='active' animation='active' container_links='active' link_dest='' lightbox_text='' lazy_loading='disabled' id='' custom_class='' template_class='' av_uid='av-kq1y46dy' sc_version='1.0']
    
    

    This is the part that you should extract to get the id of the images.

    
    ids='357,356,355,354,353'
    

    I will forward the issue to our channel. Maybe someone else will better understand what you are trying to do.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.