Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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://…&#8221;). Any advice?

    Thanks for the great theme!
    Gunther

    #1319831

    Hey 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,
    Ismael

    #1320463

    Dear 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,
    Gunther

    #1320473

    Hi,

    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,
    Ismael

    #1320506

    Hi,
    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!
    Gunther

    #1320612

    Hi,

    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,
    Ismael

    #1321000

    Thanks for the clarification and all the best.
    Gunther

    #1321015

    Hi!

    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!
    Ismael

    #1321097

    Excellent!
    Kind regards,
    Gunther

    #1321330

    Hi,

    Alright. Please do not hesitate to open another thread if you need anything else. We will close this one for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Copyright option for images including HTML’ is closed to new replies.