without getting an error. I am pretty sure its because Umbraco fetches the @ as something in the system. Since many things in Umbraco is called by "@".
But doing @@ makes the schema not getting the type of the schema markup.
So how do I work around this? Also hard to insert microdata since everything is called by "@" something.
Also using microdata I cant markup every specific thing also due to the @ call in the templates. Trying to it on this site.
Sorry for any noob questions. As said, I am completely new to working with Umbraco.
Adding an extra @ actually should escape your other @'s. I've tried copying your code, and inserting it in one of my own views. It works fine when I replace the two @ with @@.
Can you share some more of your code - eg. the view in which you insert the script tag? Then I can try giving it a look ;)
BTW - the use of @ is actually Razor, which is part of ASP.NET, which Umbraco then uses. Not that it necessarily matters, but may help if you need to search for solutions to an issue ;)
Are you simply using the testing tool and adding 2 '@' there, or are you copying / pasting the rendered html for your page ?
I ask as Anders solution is the right way to get around the razor syntax, so whilst in code it looks wrong, the resulting html rendered to the page should be fine.
Google Schema Markup/Microdata
Hey!
I am currently working on an Umbraco site. First time ever working with it.
I am trying to implement Schema Markup/ Microdata.
But I cant insert the following code in my header
`
`
without getting an error. I am pretty sure its because Umbraco fetches the @ as something in the system. Since many things in Umbraco is called by "@".
I found this thread: https://our.umbraco.org/forum/developers/razor/73608-using-google-schemas-creates-an-error-on-page
But doing @@ makes the schema not getting the type of the schema markup.
So how do I work around this? Also hard to insert microdata since everything is called by "@" something. Also using microdata I cant markup every specific thing also due to the @ call in the templates. Trying to it on this site.
Sorry for any noob questions. As said, I am completely new to working with Umbraco.
Hi,
Adding an extra
@
actually should escape your other@
's. I've tried copying your code, and inserting it in one of my own views. It works fine when I replace the two@
with@@
.Can you share some more of your code - eg. the view in which you insert the script tag? Then I can try giving it a look ;)
BTW - the use of
@
is actually Razor, which is part of ASP.NET, which Umbraco then uses. Not that it necessarily matters, but may help if you need to search for solutions to an issue ;)@Anders Bjerner
Thank you for your reply!
When testing the @@ as you mention - Google's testing tool cannot define which type of structured data it is. (Or at least I think it cant.)
Try yourself: https://search.google.com/structured-data/testing-tool/
Not sure if Google will accept it since the @type comes out as "Unspecified Type".
I am trying to insert it into SeoTags (Seo Checker extension) It looks like this right now.
And thank you once again ;)
Hi Hansen
Are you simply using the testing tool and adding 2 '@' there, or are you copying / pasting the rendered html for your page ?
I ask as Anders solution is the right way to get around the razor syntax, so whilst in code it looks wrong, the resulting html rendered to the page should be fine.
Cheers, Nigel
is working on a reply...