Edit <head> tag in RW?


(Michael Forte) #1

Hi,
I’m using Foundation and Stacks in RW8 and was wondering how to edit the contents of the head tag to add my Facebook social tags. For example, I want to add this to one page on my site.
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# business: http://ogp.me/ns/business#">

I know you can add content within the <head></head> tags but is there a way to add directly within the opening head without having to manually replace the code after publishing?


(Paul Dennison) #2

If you are using Foundation then just add the SEO Helper stack, then click on the plus icon at the bottom to add the “Facebook Open Graph” child stack to it. You add in all the bits you need in there.


(Michael Forte) #3

Hi Paul,
That’s what I was trying to do but it only allows website, article, or blog as an og:type. I need to use og:type=business.business so I have to manual enter that in to my head section. SEO stack currently doesn’t allow all of the current Open Graph options. FYI, the example I’m trying to follow for my implementation is at https://developers.facebook.com/docs/reference/opengraph/object-type/business.business/ @joeworkman @zeebe


(Joe Workman) #4

Just plop it into the head tab in the page inspector


(Michael Forte) #5

Thanks for the quick reply Joe! So you are saying it doesn’t matter that there is already a default head tag as part of the theme?

If I drop it in it will look like the following:

<head>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# business: http://ogp.me/ns/business#">
...
 </head>

Is this what you mean or is there a different way of entering it? Sorry but I’m new at these social tags.

Mike


(Joe Workman) #6

Wow. That is crazy sauce… I have never seen that syntax before. Does it work if you omit that prefix attribute in the head tag?


(Michael Forte) #7

No it doesn’t work without that head tag prefix. I tried it first without the prefix and got all kinds of errors in the Facebook debugger tool.
Here’s another link to example for an og:type of place, like Disneyland or the Eiffel Tower, for example. The same type of syntax is required in the head tag but this time referring to place instead of business. This seems to be similar to the way the schema.org works with the reference tag to the page except schema.org doesn’t require it in the head tag.
https://developers.facebook.com/docs/reference/opengraph/object-type/place/


(Michael Forte) #8

Here is a link to all of the open graph “og:type” options. https://developers.facebook.com/docs/reference/opengraph#object-type


(Joe Workman) #9

You are sure that you have tested it with all of the proper meta tags in the head and its not worked without the prefix data in the tab? How did you know that it did not work? Can you show me with the debugger?


(Joe Workman) #10

You can also use this JS approach instead of with HTML markup…


(Michael Forte) #11

The errors have now stopped since I removed the SEO stack. Apparently, I was getting a conflict of having 2 og:types listed at the same (article from the SEO stack and business.business entered manually). This caused the debugger to reject everything. It appears to be working now. I’ll let you know if I see this again.

I appreciate all your help with this. I would much rather use the SEO stack as it’s much cleaner. To do that, I would need all of the various og:types in the pulldown of the SEO stack instead of only website, article, and blog. Also, it would be very useful to allow the addition of other properties and content since there are hundreds of them that are not in the stack. This would work similar to how “Other Tags” works in the Page Inspector.
Do you think it would be possible to add those in the next release?


(system) #12

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.