Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1337481

    Hi,
    we are using Enfold for an ecommerce plattform in combination with WooCommerce. Two days ago we got errors in the serch console.
    Problems arise from a gallery that seems to be missing a parameter “url” or “contentUrl”. This was already a must have for videos but seems to be new for galleries?
    See here for a direct link to an example of the issue: https://search.google.com/test/rich-results/result?id=7PMDJjsJ9w_TRPvUaCdwAA

    Thanks for checking. Best regards Sascha

    #1338005

    Hey saschapi,

    Thank you for the inquiry.

    We can manually add the contentURL property to the avia-gallery container, but we have to directly edit the enfold/config-templatebuilder/avia-shortcodes/gallery/gallery.php. Around line 697, look for this code.

    $output .= "<div {$meta['custom_el_id']} class='{$container_class} avia-gallery-" . self::$gallery . "' {$markup_gallery}>";
    

    Below, add the meta element with the contentURL property and the post title as content value.

    			
    $title = get_the_title(get_the_ID());
    $output .=		"<meta itemprop='contentURL' content='{$title}'>{$title}</meta>";
    

    Best regards,
    Ismael

    #1338006

    Thanks for this input. As this is disruptive (as it gets lost with every update), it should be included in the enfold core. It’s not breaking anything and will pop up more often, as the error in search console impacts more people.

    I believe I cannot add this as a feature request, as the form is currently not available. Could you please forward it?
    Thanks Sascha

    #1338024

    Hi,

    Thank you for the update.

    We will forward the modification to our channel for further consideration. For now, you will have to modify the shortcode file directly, or override it in the child theme. For more info on how to override a shortcode or builder elements, please check this documentation.

    // https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb

    Best regards,
    Ismael

    #1339761

    Yes but should it be visible in the frontend? Look:

    allthough i see in the gallery.php the meta end tag – it is not in the DOM – maybe that is the reason why the content is visible – because it is not inside the meta tag.
    but:
    “This element must not contain any content, and does not need a closing tag.”
    Is it necessary to have here content?


    i think it will be enough if that line is:

    $markup_meta = '<meta itemprop="contentURL" content="'. esc_attr( $post_title ) .'">';
    

    Next: if we have here a itemprop=”contentURL” shouldn’t we have then a content=”url-whatever” ? and no title

    $post_link = trim( get_the_permalink( get_the_ID() ) );
    $markup_meta = '<meta itemprop="contentURL" content="' . esc_attr( $post_link ) . '" />';
    #1339910

    Hey!

    Thank you for the observation @Guenni007. Yes, you are correct. We should use the URL as the content value, not the page title. We will adjust the changes in the next patch.

    Cheers!
    Ismael

    #1339925

    Thanks – i have only adjusted the final version in my suggestion above, in case someone pulls out the fix here.
    Can be closed
    your link to your fix is here: https://pastebin.com/uDHPrFhJ

    #1340091

    Hi,

    Alright. Have a nice day!

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘ContentUrl or url missing from rich snippets’ is closed to new replies.