-
AuthorPosts
-
October 1, 2020 at 11:42 pm #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
October 6, 2020 at 1:11 pm #1250840Hey 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,
IsmaelOctober 6, 2020 at 2:31 pm #1250858Hello 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émiOctober 8, 2020 at 11:33 am #1251378Hi,
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,
IsmaelOctober 8, 2020 at 2:47 pm #1251441This reply has been marked as private.October 9, 2020 at 1:40 pm #1251700Hi,
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,
IsmaelOctober 9, 2020 at 2:19 pm #1251713Hello 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émiOctober 12, 2020 at 4:50 am #1252156Hi,
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,
IsmaelOctober 12, 2020 at 4:10 pm #1252299This reply has been marked as private.October 16, 2020 at 4:31 am #1253127Hi,
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.
October 16, 2020 at 2:59 pm #1253261Wonderful, 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.phpEnfold 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
October 20, 2020 at 8:09 am #1254248 -
AuthorPosts
- The topic ‘Enfold masonry media description’ is closed to new replies.