Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1249951

    Hi,

    There is 2 fields used in the masonry overlay available in the media library. Image Title and Legend. Would it be possible to add on a third line the image media description?

    https://snipboard.io/mb89NB.jpg

    Regards,

    Rémi

    #1250840

    Hey Rémi,

    Thank you for the inquiry.

    Yes, this should be possible but we have to modify the enfold\config-templatebuilder\avia-shortcodes\av-helper-masonry.php file. The image caption is added around line 516.

    $items .=	"<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
    

    We could add the description below it.

    $items .=	"<div class='av-masonry-entry-description' {$markup}>{$loop_content}</div>";
    

    Best regards,
    Ismael

    #1250858

    Hello Ismael,
    I did edit the file successfully, but the new line is not working.

    if( strpos( $this->atts['caption_elements'], 'excerpt' ) !== false && ! empty( $content ) )
    {
    $markup = avia_markup_helper( array( 'context' => 'entry_content', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup'] ) );
    $items .=	"<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
    $items .=	"<div class='av-masonry-entry-description' {$markup}>{$loop_content}</div>";
    }

    Just to be sure, are we referring to the same field? https://snipboard.io/OqApg1.jpg

    Regards,
    Rémi

    #1251378

    Hi,

    Yes, the code above should display the value of the Description field.

    Did you add an excerpt or caption to the gallery? These fields will only display if the gallery item has a caption.

    Best regards,
    Ismael

    #1251441
    This reply has been marked as private.
    #1251700

    Hi,

    Thank you for the info.

    Yes, the diagram is correct. The code above should display the $loop_content or post_content which holds the image description. Did you remove the cache after doing the modification?

    Best regards,
    Ismael

    #1251713

    Hello Ismael,
    Yes, the cache was removed. I’ve also tried another browser.
    You’ll see that the description is empty in the code, but not in WordPress…
    https://snipboard.io/kH8MSh.jpg
    https://snipboard.io/OqApg1.jpg
    Regards,
    Rémi

    #1252156

    Hi,

    Thank you for the update.

    We might have to access the server and edit the files in order to check the issue properly. Please post the FTP details in the private field so that we could test the modification.

    Best regards,
    Ismael

    #1252299
    This reply has been marked as private.
    #1253127

    Hi,

    Thank you for the info.

    We modified that line a bit to show the image_content instead of the post_content.

    $items .=	"<div class='av-masonry-entry-description' {$markup}>{$entry['image_content']}</div>";
    

    Please remove the browser cache before checking the page. (see private field)

    Best regards,
    Ismael

    • This reply was modified 4 years, 1 month ago by Ismael.
    #1253261

    Wonderful, thanks for your perseverance.

    Note to myself just in case I have to reinstall this.
    /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php

    Enfold 4.7, line 538

    if( strpos( $this->atts['caption_elements'], 'excerpt' ) !== false && ! empty( $content ) )
    	{
    		$markup = avia_markup_helper( array( 'context' => 'entry_content', 'echo' => false, 'id' => $entry['ID'], 'custom_markup' => $this->atts['custom_markup'] ) );
    		$items .=	"<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";
    		// Add this line for Image media Description
    		$items .=	"<div class='av-masonry-entry-description' {$markup}>{$entry['image_content']}</div>";
    	}
    • This reply was modified 4 years, 1 month ago by lptornade. Reason: Code part
    #1254248

    Hi,

    You are welcome! Thank you for the additional info. Please do not hesitate to open a new thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Enfold masonry media description’ is closed to new replies.