wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Add schema support for FSE templates

Open monbauza opened this issue 2 years ago • 6 comments

Moved from: https://yoast.atlassian.net/browse/PC-761 Reporter: @leonidasmi

Description

When we add blocks that add schema, in a FSE template, that isn’t considered when we output the frontend of a post of that template. Example:

  • Go to the Site Editor and edit the Post template
  • Add a Yoast How-to block in the Post template and save
  • Create a post and check its schema
  • In the schema no HowTo object is being output

We need to make sure we add support for that

Replicated both with WP 6.0.2 and 6.1 - with the Twenty Twenty-Two theme (which is a FSE theme)

monbauza avatar May 23 '23 09:05 monbauza

Comment from Lars van Rhijn:

We need to adjust the get function in meta-tags-context-memoizer.php to also include the template blocks inside the $blocks variable. We might also need to change other schema generators that use the post content to generate their schema (such as faq.php).

There is only one problem, there is currently no nice way to request the template that is being rendered within WordPress. We might need to use resolve_block_template but this function is marked as private. We could also use $_wp_current_template_content but this global variable is also marked as being private.

monbauza avatar May 23 '23 09:05 monbauza

+1 https://wordpress.org/support/topic/faq-block-added-but-faq-schema-not-showing-up/

monbauza avatar May 23 '23 09:05 monbauza

Maybe introducing a filter to allow modifying the context/content can be a partial and temporary solution.

asafm7 avatar May 23 '23 11:05 asafm7

@monbauza, is there an update on this?

asafm7 avatar Apr 06 '24 17:04 asafm7

@asafm7 Thank you for reaching out to us! I'm sorry to let you know that the issue is not yet fixed.

Our product team will assess the severity of the issue and assign a priority level to the report. Our developers work on the highest priority issues first. We cannot give you an estimate of when they'll start working on the issue.

We will keep you posted with further updates once available.

josevarghese avatar Apr 08 '24 06:04 josevarghese

Thanks.

asafm7 avatar Apr 08 '24 09:04 asafm7