Hi,

To reproduce:
1) install module, enable schema_recipe sub-module.
2) create a node type with a field "field_recipe_step"
3) set-up the schema.org admin page to use the token [node:field_recipe_step] for the recipeInstructions
4) create a recipe node
5) verify the schema.org json.
6) We used the following service for verification: https://search.google.com/structured-data/testing-tool/u/0/

Currently it looks like (which is also considered valid via the service above):

"recipeInstructions": [
"Step 1.",
"Step 2."
],

But should look like:

"recipeInstructions": [
{
"@type": "HowToStep",
"text": "Step 1."
}, {
"@type": "HowToStep",
"text": "Step 2."
}
],

Comments

jjchinquist created an issue. See original summary.

karens’s picture

There are two valid ways of representing instructions. One is a single block of text, the other is an ordered list of "HowToStep"s. There is no way in the current architecture of the module to offer both options, since they require totally different source data. Only a list of steps will work in HowToStep. The block of text works either way (if you have a list, it is just concatenated together). Since the block of text will work for any source data, and the list works only if you have each step separated out, the first is a better option for this module to support. We have no reason to assume that everyone who uses this will have configured instructions as a list or multiple value field.

If someone who understands how the code works can see a way to offer both options, I'd be glad to offer that. But I don't think it can be done. So the best solution is the current solution, which should work for everyone.

karens’s picture

Status: Active » Closed (works as designed)
christophweber’s picture

And to provide some color and history: Back when I implemented the current block of text solution I had experimented with both and after some discussion the current simple solution was decided on. See https://www.drupal.org/project/schema_metatag/issues/2933278