Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #748153

    Hi,

    I have created a shortcode [lightboxbildanfrage] which works fine when I add it to the normal text block within a page.

    But now I would like to add it in the image caption within the “Masonry Gallery”, looks like this:

    But there the shortcode is not “executed”, it appears in the lightbox as “clear text”:

    The shortcode, that I have created within the “Code Snippets” plugin is this:

    // Add Shortcode
    function contentblock_lightboxbildanfrage() {
    return '
    	<span class="mfp-title"><a href="https://mywebsite.de/kontakt/bildanfrage/" title="Bild anfragen">Bild anfragen</a></span>
    ';
    }
    add_shortcode( 'lightboxbildanfrage', 'contentblock_lightboxbildanfrage' );

    I would like this custom shortcode being “executed” within the lightbox (!) view of an image within the Masonry Gallery.
    I need to work with a shortcode, so that I can easily change the content of it for ALL my images globally.

    Is there any chance or “hack” to get a shortcode “executed” within the image caption when using the Masonry Gallery element of ALB?
    Thank you.

    ————————————————
    UPDATE:
    I found this https://codex.wordpress.org/Plugin_API/Filter_Reference/img_caption_shortcode,
    perhaps with this something can be “made”, so that a shortcode as mentioned above in Masonry Gallery image lightboxes is “executed”, but my PHP is too bad for getting this done, if someone could help me out please. Thank you!

    • This topic was modified 7 years, 5 months ago by BeeCee. Reason: added an Update
    #750000

    Hey Chris,

    We would be glad to help you with this customization, but at the moment there is no easy way to do this by using a small custom code snippet, so I am afraid its out of the scope of our support.

    But please feel free to request such feature at our feature request system: https://kriesi.at/support/enfold-feature-requests/

    This system allows us to keep track of user suggestions and lets you vote on the feature you would like to see the most. I am afraid though there is no guarantee that a feature will get implemented. If that’s something you really need you can always try to hire a developer for the task :)

    Best regards,
    Yigit

    #750022

    Thanks, I got the solution in a Facebook group, it is quite simple:

    in
    config-templatebuilder/avia-shortcodes/av-helper-masonry.php

    I’ve made these changes, search for

    extract(array_merge($defaults, $entry));

    and then add directly below this:

    $content = do_shortcode($content);
    $the_title = do_shortcode($the_title);
    $description = do_shortcode($description);

    Note your changes (I do this in Evernote), because after a theme update, this might be lost! Works fine!

    #750023

    Hi!

    Glad you figured it out and thanks for sharing your solution!

    Please create a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ and move your modified element into your child theme – http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/

    Best regards,
    Yigit

    #1114348

    Hi! i need this exact thing, is super important that i have it. But your solution is not working for me. Is that the only change you did? plus when i enter those 3 lines in av-helper-masonry.php, the layout breaks.

    Any idea will be super appreciated!

    Thanx!

    #1114383

    Hey jjsabatino,

    Please provide a link to your site so we can look into this further.

    Best regards,
    Jordan Shannon

    #1114442

    Sure, i didn´t add it cause it´s not relevant but here it is on private content. It´s important because the client will be adding a lot of images and will change names. And with the shortcode it will be way easier to change a lot of names at once.

    #1115546

    Hi jjsabatino,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #1256970

    Hi, I have trouble similar to this. Is there a way to make forms shortcode work inside the mpf title area in lightbox? The shortcode works only when you open the portfolio page. I have tried to place the do shortcode line inside the masonry file but it didnt help.

    Screenshot
    Screenshot

    What I wanted to achieve is that the visitors can already send inquiries while the lightbox image is open. Similar to Facebook where users can comment while image is open.

    Hope you can help me.

    Thanks!

    • This reply was modified 3 years, 9 months ago by melaniecuando. Reason: Add what I want to achieve. Ty!
    #1257918

    Hi,

    That might not be possible because the lightbox script only renders content of the title area based on the title or alt attribute of the image or the parent link, or based on the content of a specific container. You might have to render the form or shortcode somewhere else, then use a custom script to append it to the lightbox container or the title area. Unfortunately, this will require modifications that are beyond the scope of support.

    Best regards,
    Ismael

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