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

    Hello,
    Iam building a listing site with both Enfold and Toolset types.
    While designing a (Toolset) layout to single display custom posts, I’d like to use the Avia gallery to properly display images saved into a custom field (listing-images). I am using the following Avia shortcode to do this: [av_gallery ids='' style='big_thumb' preview_size='portfolio' crop_big_preview_thumbnail='avia-gallery-big-crop-thumb' thumb_size='portfolio' columns='5' imagelink='lightbox' lazyload='avia_lazyload'], where ids=” could be something like: ids='[wpv-post-field name=’wpcf-listing-images’]’, with a ‘for each’ loop.
    So far, I get the gallery to work within the layout but, as it does not know which image to look for, it displays the first images saved into the media library.
    Indeed, the normal use of this shortcode is to specify some images from the media library that are then designated with 4digits figures inside the shortcode; f.i. ids= ‘1138,1139,1140’…
    So is there any way, instead, to get/embed multiples images saved in a custom field (created with Toolset or otherwise)?

    Thanks for your help.

    #788887

    Hey Sim0nb,
    There is no easy way to do this in Enfold without extensive theme editing, from the Toolset video: https://vimeo.com/176428571 it seems to show embed multiples images saved in a custom field, perhaps it’s just what your looking for.
    postimage

    Best regards,
    Mike

    #789063

    Hey Mike,

    Thanks for your hint.
    Actually, I have already modified Enfold single.php file and put in child theme so that it can display a customized template (Layout in Toolset parlance) conditionnaly for my custom post type with custom fields; this integrates flawlessly wihin Enfold.
    My very specific question is about understanding how I can retrieve/generate those images ids numbers used in the av_gallery shortcode for each posts where images are saved within a custom field, so that I can use this gallery view without having to specify images manually.
    I hope you can help me there as it would allow a dynamic use of Enfold brilliant design.

    Thanks again,

    #789934

    Hi,
    I’ll ask the rest of the team for advice.

    Best regards,
    Mike

    #790015

    Hi Mike,
    Thanks for that.
    In the meantime, I think the ‘ids’ numbers actually correspond to the post ID of each image as referred to in the wp_posts table.
    I suppose one can dynamically retrieve those based on their post_parent number (the actual post there were attached to).
    I’ll look further into it although I am alas no ‘hard core’ programmer so, still, any help is most welcome ;)
    Cheers.

    #790892

    Hi,

    Could you please provide a link to the page where you’re testing this? And post the content of the custom single.php template on pastebin.com. We would like to check it. What value/values does the [wpv-post-field] returns? Maybe, you can assign it as a separate variable. Example:

    $images = do_shortcode("[wpv-post-field]");
    echo do_shortcode("[av_gallery ids='".$images."' style='big_thumb' preview_size='portfolio' crop_big_preview_thumbnail='avia-gallery-big-crop-thumb' thumb_size='portfolio' columns='5' imagelink='lightbox' lazyload='avia_lazyload']");

    Best regards,
    Ismael

    #791058

    Hello Ismael,

    Thanks for the suggestion; the shortcode [wpv-post-field] is not ok for getting images IDs. So I have placed in function php a routine to extract said ids and create a shortcode called [get-images-ids] to enable the display of the Ids list. This works in standalone but not within av-gallery (so far).
    Also, I have tried your suggested shortcode in function.php but get the following error:

    [av_gallery ids='1' style='big_thumb' preview_size='portfolio' crop_big_preview_thumbnail='avia-gallery-big-crop-thumb' thumb_size='portfolio' columns='5' imagelink='lightbox' lazyload='avia_lazyload']
    Warning: Cannot modify header information – headers already sent by (output started at /home/mysite/public_html/testbed/wp-content/themes/aja911/functions.php:110) in /home/mysite/public_html/testbed/wp-content/plugins/toolset-module-manager/common/Settings.php on line 78

    Still it might be the way to go. I have sent you credentials in the private messaging area.
    Thanks.

    • This reply was modified 6 years, 11 months ago by Sim0nb.
    #792007

    Hi,

    I’m sorry but I don’t think nested shortcodes are going to work in the plugin’s layout editor. Add the shortcodes in a template file. What value/values does the [wpv-post-field] returns? Please contact the plugin author for additional help.

    Best regards,
    Ismael

    #792287

    Hello Ismael,

    Indeed, the solution lied within Toolset plugin; more particularly, I had to register the newly generated shortcode (the one used to extract images ids number suite) within Toolset/settings prior to try embed it into av_gallery shortcode.
    Now everything is fine, so you can close this ticket.

    Thanks for your time

    #792704

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to dynamically feed images into Enfold gallery shortcode [av_gallery]?’ is closed to new replies.