
-
AuthorPosts
-
September 5, 2021 at 11:41 am #1319780
Hi,
the Image Media Element allows to display Copyright Info on hover or below image. This information is retrieved from the Media Library. Enfold previously allowed to include HTML (e.g. in order to link to the creator or Creative Commons license of an image), but now only plain HTML text is displayed (“… licensed under <a href=”https://…”). Any advice?Thanks for the great theme!
GuntherSeptember 6, 2021 at 5:48 am #1319831Hey gunther_bensch,
Thank you for the inquiry.
The theme automatically strips html tags from the copyright text, which is why you cannot add the link manually. But if you want to allow html tags, we can edit the enfold/config-templatebuilder/avia-shortcodes/image/image.php file and remove the esc_html function in this code around line 849.
$copyright_tag = '<small class="avia-copyright">' . esc_html( $copyright_text ) . '</small>';
Remove the esc_html function or replace the code with this one.
$copyright_tag = '<small class="avia-copyright">' . $copyright_text . '</small>';
Best regards,
IsmaelSeptember 10, 2021 at 9:06 pm #1320463Dear Ismael,
that worked out – thanks so much! (I understand this is something I’ll have to adjust each time I update the enfold theme – please just let me know if there is a more elegant way).
Best,
GuntherSeptember 11, 2021 at 2:00 am #1320473Hi,
Thank you for the update.
We could override the image shortcode file in the child theme. Create a new folder in the child theme directory and name it “shortcodes”. Create a copy of the image.php file, move it inside the new folder, then add this snippet in the functions.php file to create an additional shortcodes path within the child theme.
function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Best regards,
IsmaelSeptember 11, 2021 at 11:54 am #1320506Hi,
indeed, that would be an option, but – instead of having to change one line under the enfold theme – I’d have to check the entire image.php file under the enfold child theme each time there is a theme update (isn’t it?).
Maybe this will anyways be fixed in a future theme update – in any case, thanks again!
GuntherSeptember 13, 2021 at 2:11 am #1320612Hi,
Yes, you may have to update the image.php file if there are changes in it. Unfortunately, we will not be removing the esc_html function in the next patch because it was added there to clean invalid output and escaped special characters. But we could add a filter so that it can still be adjusted if necessary. We will forward the thread to our channel for further consideration.
Best regards,
IsmaelSeptember 15, 2021 at 8:05 am #1321000Thanks for the clarification and all the best.
GuntherSeptember 15, 2021 at 11:10 am #1321015Hi!
A filter for the copyright content will be added in the next patch according to the our developer. You will be able to use the filter in the functions.php file instead of directly modifying the shortcode file. For now, please keep the modification until the next theme update.
Thank you for your patience.
Cheers!
IsmaelSeptember 15, 2021 at 6:07 pm #1321097Excellent!
Kind regards,
GuntherSeptember 17, 2021 at 7:11 am #1321330 -
AuthorPosts
- The topic ‘Copyright option for images including HTML’ is closed to new replies.