How To Add Structured Data Markup?

Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
I went to google and made a structured data markup of an article on my site and want to add it to it. It says just download the file and add it to the source code if this is so where and how exactly do i do that so i dont mess anything up?
updated by @zachary-moonshine: 06/08/18 01:47:19AM
paul
@paul
6 years ago
4,326 posts
What is it that needs to be added? Is it a script or a block of code? If so it'll likely need to go in the header, footer or meta templates.


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
google let me download the file of it called markup html. and said i can just copy and paste it to my source code?
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
"A simple alternative is to download the automatically-generated HTML file, and copy/paste it into your CMS or source code."
https://blog.kissmetrics.com/get-started-using-schema/
michael
@michael
6 years ago
7,721 posts
You'll need to adjust the skin to add in the parts that its looking for. Its been on our todo list for a while but always down the bottom.

Thanks for the link.
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
Ok cool, well i didn't create a markup file for the whole site, i just did it for one blog. So should i add the code to the main skin or the blog tpl? I tried uploading the html file to the site and then checked and google could not see it so not sure? But from what you are saying is that something is missing is why i cant do that ?
michael
@michael
6 years ago
7,721 posts
its just saying add "xxxxx" to certain parts to tell us what that part is. So add the parts to the right parts.

https://schema.org/docs/gs.html#microdata_itemscope_itemtype

it says if you have this:
<div>
 <h1>Avatar</h1>
 <span>Director: James Cameron (born August 16, 1954)</span>
 <span>Science fiction</span>
 <a href="../movies/avatar-theatrical-trailer.html">Trailer</a>
</div>
change it to:
<div itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <div itemprop="director" itemscope itemtype="http://schema.org/Person">
  Director: <span itemprop="name">James Cameron</span> (born <span itemprop="birthDate">August 16, 1954</span>)
  </div>
  <span itemprop="genre">Science fiction</span>
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
so just open the template view in the editor of that blog page and do it in there ?
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
i think my main problem is i cant find where the source code is for each blog post ?
michael
@michael
6 years ago
7,721 posts
in the templates.

For a blog post it will either be at /modules/jrBlog/templates/item_detail.tpl or in the skin at jrBlog_item_detail.tpl

Docs: "Altering a modules template"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1051/altering-a-modules-template
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
that shows the overall blog but how do i edit the source code for one specific url of a blog
brian
@brian
6 years ago
10,148 posts
Zachary Moonshine:
that shows the overall blog but how do i edit the source code for one specific url of a blog

You can't - you have to use variables to make the template unique.

Note that I DO have a structured data module in the works that will handle this for you. If you can wait a bit it will end up being released - not real fast as it's been sponsored by a customer so they will get first shot at it and there will be some back and forth. Note too that the google structured data is kind of a mess - it works well if you're blogging or sharing recipes - not so good for media sites. Look at the "Content Types" under the feature guide section - you'll see that the Music one is invite only by Google.

To be 100% frank this is where Google really sucks. Their whole goal is to get YOUR content onto their site (AMP) so they can reap the benefits while throwing you a few pennies (the real money is in the behavioral analytics behind the actual content viewers that they sell to their advertising partners).

If your "SEO" scanner thing is telling you that you need to have structured data, ignore it for now. If your site gets big enough Google will structure it for you in their results.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
6 years ago
824 posts
Thats cool @brian i will just wait then for the module, sounds good.