0

I am building a site using Drupal 7 and the schema.org module and the microdata module.

The site is live on production server (and works good).

When checking a url from my site site on the google rich snippets tool, I can't see all the fields I want to appear in the snippets.

When using panels, views, microdata module and schema.org module - the snippets does not work. When I deactivated the microdata module, and disabled the specific panel on the page the snippets work!
So, I decided to disabled the microdata module, and work only with the schema.org module.

With the the schema.org modules:

  • When views is on "show: content" and the panel Enabled - snippets work!

  • When views is on "show: fields" and the panel Disabled - snippets work!

  • When views is on "show: fields" and the panel Enabled - snippets do NOT work!

    Can I use the Rewrite option on a view to add some code to fields and make it work? How can I display the Google rich snippets when a view is on Show: fields and the panel enabled?

3
  • Scroll down in that page and check if type: http://schema.org/recipe is being extracted. That would be the first place to look.
    – Gokul N K
    Feb 20, 2014 at 11:54
  • @GokulNK Thanks for your comment. I updated my questions according to your comment.
    – EB84
    Feb 20, 2014 at 12:20
  • I haven't spent a great deal of time trying to understand the problem, but it sounds quite similar to something I recognize, so I figure I'd comment. Panels redoes the way nodes are rendered. Some modules rely on "Do stuff X when a node is rendered". Since panels bypasses the normal rendering, these modules all break. Possibly this is the case here. I've posted a generic workaround in the issue queue some time ago, which basically silently renders a node normally and throws the result away. Ugly, but works. Better solutions depend on the exact module in question.
    – Letharion
    Feb 21, 2014 at 13:58

1 Answer 1

0

I see that you are using views fields mode for populating the values. That might be the issue.

In your overall HTML check that an entry for itemtype="http://schema.org/Recipe"> is present. In your current html I feel you wouldn't have this. If that is the case then change the mode in your views to node from fields.

Then recheck your HTML and you should find the entry. If you do find the entry then the reason is that your fields(in old view mode) are not enclosed within a recipe tag.

In the above case you can install schema tokens module and then in your fields view, hide all the fields and then add a Global text field within which you can use these tokens to get the desired output.

3
  • 1
    I am using panels and panel fields. All my site is built through content panes (views) and panels, panels fields.I don't think I can change the content pane from fields to node. Can I use the schema tokens module with panels fields?
    – EB84
    Feb 20, 2014 at 13:18
  • If your node is in the scope and you can use the node tokens, then you can use schema tokens as well.
    – Gokul N K
    Feb 20, 2014 at 13:22
  • I tried to use the schema.org tokens, but I think I did not understand correctly. I don't see it in the "placements pattern" on the field on views, and I have no idea what to write and where. I tried to write: "%node:field_schemaorg_image" but it just printed the characters. I tried adding this token in the panel, but it just printed the url for the photo.
    – EB84
    Feb 21, 2014 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.