I am starting to make blogger templates from scratch and i am making a research about best SEO metadata for each post. I think the most logical way to use meta name=keywords is to use post labels as keywords but i don’t understand why i cant retrieve the data and display it in the meta section as i can with the data from description. for expample:
<b:if cond='data:blog.pageType != "error_page"'>
<meta expr:content='data:blog.metaDescription' name='description'/>
</b:if>
puts the data comming from blog.metaDescription as content for meta description, but when i want to use:
<meta expr:content='data:post.labels.name' name='keywords' />
Which should be the data retrieved from the post labels, it doesn’t display anything… as if there is no such data… i wonder why please help … i am going mad with this, i tried a lot of stuff and i cant accomplish to use post labels as meta keywords.
Best Regards
2
Answers
You can only retrieve post labels inside Blog Posts widget
<b:widget type='Blog' ...>
and that is through a loop tag like the followingOr you can also use a lambda expression
The following code should work –
But the shortcoming being that it will only work in the post area (present inside the
<body>
tag) and not in the<head>
region