I've signed up for the paid account of Google Site Search.
The documentation is very bad.
Does anyone know how I add my company's logo to the results page?
Thank you
check out this url, maybe help you.
https://developers.google.com/structured-data/customize/logos?hl=ro
I have used this code:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"url": "http://yoursiteURL.com",
"logo": "http://yoursiteURL.com/images/logo.png"
}
</script>
Related
That's it, my costumer has a website that has free content for professions like doctors and attorneys, that have a number they can prove they're from the proffession.
The content is hidden behind a registration that asks for that number, but aside from that, the registration is free.
I'm going to create preview articles for the website, so search engines can index titles and content previews.
From the research I've done, I found that for paywalled content, there is a isAccessibleForFree property that can be set to false, but how do I tell search engines that it's behind a "Free paywall"?
More specifically, what's the markup for telling them the content is free but not available without a login?
More specifically, what's the markup for telling them the content is free but not available without a login?
The isAccessibleForFree property is exactly what you need. Its purpose is to explain that the content is not directly accessible, regardless of whether this is due to the fact that you need to log in. Here is an example implementation provided by Google:
<html>
<head>
<title>Article headline</title>
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "NewsArticle",
"headline": "Article headline",
"image": "https://example.org/thumbnail1.jpg",
"datePublished": "2025-02-05T08:00:00+08:00",
"dateModified": "2025-02-05T09:20:00+08:00",
"author": {
"#type": "Person",
"name": "John Doe"
},
"description": "A most wonderful article",
"isAccessibleForFree": "False",
"hasPart":
{
"#type": "WebPageElement",
"isAccessibleForFree": "False",
"cssSelector" : ".paywall"
}
}
</script>
</head>
<body>
<div class="non-paywall">
Non-Paywalled Content
</div>
<div class="paywall">
Paywalled Content
</div>
</body>
</html>
The rest of the details could be found on their website: Structured data for subscription and paywalled content
This link here mentions how to access translations for your app blocks but the example doesn't seem to work and seems to be for regular sections instead of app blocks:
https://shopify.dev/themes/architecture/sections/section-schema#locales
My locales section looks like the following:
"locales": {
"en": {
"title": "Slideshow"
},
"fr": {
"title": "Diaporama"
}
}
I've tried a bunch of different permutations using the name of my section and the name of the file but nothing works. According to the documentation the below should work:
sections.[section-name].[translation-description]
I've also tried the two below which both don't work:
blocks.[section-name].[translation-description]
block.[section-name].[translation-description]
Something tells me I'm doing something wrong or Shopify's documentation is lacking.
Any help on this would be much appreciated!
You can check Shopify's example theme extension app https://github.com/Shopify/product-reviews-sample-app/tree/main/theme-app-extension/locales
basically, you need this format
{ "blocks": { "average-rating": { "name": "Average Review Score",
"settings": { "stars_fill_color": {
"label": "Stars color" }
} } }}
for accesing a label you should do "t:blocks.average-rating.settings.stars_fill_color.label"
I have an ecommerce site, and I'm trying to create a "Lookbook" template. I want my client to be able to create a new lookbook (just as a simple page with a template of "page.lookbook" or similar), then be able to go into the page admin and select and upload images, links, descriptions etc.
So far I have:
page.lookbook.liquid -> calls in the section, lookbook-template.liquid
lookbook-template.liquid has an HTML template
It also has this schema:
{% schema %}
{
"name": "Lookbook",
"blocks": [
{
"type": "Image",
"name": "Lookbook image",
"settings":[
{
"type": "image_picker",
"id": "img",
"label": "Image"
},
{
"type": "text",
"id": "description",
"label": "Description",
"default": "<p>You can write <em>html</em> in here!</p>"
}
]
}
]
}
{% endschema %}
This way, my client can use the simple admin tools to add a new image block. Very nice!
However, this method means that every single lookbook gets the SAME image data as whatever I apply to the lookbook-template.liquid, and this isn't ideal at all.
What am I doing wrong here, and what's the right solution? I want one template that the client choose to attach to a page, and then for each template to have a unique set of images, links and descriptions that the client creates.
Unfortunately, section won't work to get some different content for each page with lookbook.page template.
A solution would be to install (or create) an app to manage metafields attached to pages. Then you can use metafields in your template.
Metafields is a way to add some extra fields in database:
https://help.shopify.com/themes/liquid/objects/metafield
Is there anyway to use JSON-LD without including the script inline in the HTML, but still get Google (& other) spiders to find it? Looking around I've seen some conflicting information.
If this was the JSON-LD file:
<script type="application/ld+json">
{
"#context" : "http://schema.org",
"#type" : "WebSite",
"name" : "Example Site",
"alternateName" : "example",
"description" : "Welcome to this WebSite",
"headline" : "Welcome to Website",
"logo" : "https://example.com/public/images/logo.png",
"url" : "https://example.com/"
}
</script>
And I have this in the head of the HTML:
<script src="/public/json-ld.json" type="application/ld+json"></script>
EDIT: I've also tried:
<link href="/public/json-ld.json" rel="alternate" type="application/ld+" />
Google Spiders seem to miss it and so does the testing tool unless I point it directly at the file. I'm trying to work around unsafe-inline in the CSP. And the only thing I can find is this, which would work in Chrome but don't want to be firing console errors on every other browser. Plus, I just like the idea of Schema.org data being abstracted out of the page structure. Would adding the JSON-LD to the sitemap for Google Webmaster Tools help?
Apologies, total noob to JSON-lD and keep ending up in email documentation (this would be for a site) or old documentation.
True, it can not be made external and it is not supported inline, but you can still achieve what you want by injecting it into the DOM via a JavaScript file.
Note: I am using an array for neatness so I can segment all the structured data elements and add an infinite amount of them. I have a more complicated version of this code on my websites and actually have an external server side rendered file masquerading as a JavaScript file.
An yes Google search bot does understand it. May take days for it to register and using Webmaster tools to force a re-crawl does not seem to force a refresh of JSON-LD data - seems like you just have to wait.
var structuredData = {
schema: {
corporation: {
'#context': 'http://schema.org',
'#type': 'Corporation',
'name': 'Acme',
'url': 'https://acme.com',
'contactPoint':
{
'#type': 'ContactPoint',
'telephone': '+1-1234-567-890',
'contactType': 'customer service',
'areaServed': 'US'
}
},
service: {
'#context': 'http://schema.org/',
'#type': 'Service',
'name': 'Code optimization',
'serviceOutput' : 'Externalized json',
'description': 'Inline json to externalized json'
},
},
init: function () {
var g = [];
var sd = structuredData;
g.push(sd.schema.corporation);
g.push(sd.schema.service);
//etc.
var o = document.createElement('script');
o.type = 'application/ld+json';
o.innerHTML = JSON.stringify(g);
var d = document; (d.head || d.body).appendChild(o);
}
}
structuredData.init();
I have this awesome working code that pulls Autocomplete suggestions from Wikipedia. This is really useful, except that I'd like it to only recommend Bands. So for instance, typing in "Pink" would only return /bands/ that start with the word "Pink", rather than everything in the world dealing with 'Pink'.
Does anyone know how to accomplish this? http://codepen.io/anon/pen/VePapK
I found there's a way to filter results by category by using the query action here (rather than opensearch), but the strange thing is that there doesn't seem to be a broad "Music" or "Bands" category. So that's opening even more unanswered questions.... Any help appreciated.
EDIT: Alternatively, if anyone knows an easier way to feature an updated list of all significant bands on your site's dropdown, please let me know.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form method="get" id="search">
<input type="text" class="searchbox" value="Type here.. " onblur="if(this.value == '') { this.value = 'Type here..'; }" onfocus="if(this.value == 'Type here..') { this.value = ''; }" name="s">
<button type="submit">Submit</button>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script type="text/javascript">
$(".searchbox").autocomplete({
source: function(request, response) {
console.log(request.term);
$.ajax({
url: "http://en.wikipedia.org/w/api.php",
dataType: "jsonp",
data: {
'action': "opensearch",
'format': "json",
'search': request.term
},
success: function(data) {
response(data[1]);
}
});
}
});
</script>
</body>
</html>
There are indeed a lot of questions to open about Wikipedia's category system. Thankfully, there is a better way.
Here is an alternative approach that will get you what you need from Wikipedia search: you can use search parameters with Wikipedia's CirrusSearch API to get articles within a category (via incategory:<category title>), with a link to another Wikipedia page (via linksto:<page name>), or by a page that transcludes a common Wikipedia template (via hastemplate:<template name>). If you know the right Wikipedia category or page, you can use the first two options easily. Although the last one might sound odd, Wikipedia's well organized template system may be your best bet. Many band articles will have a common infobox on the right that will help you narrow your search to bands.
You can use CirrusSearch and hastemplate:Infobox_musical_artist together like this:
https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=hastemplate%3AInfobox_musical_artist+daft
Which returns a list of pages in this format:
{
"batchcomplete": "",
"continue": {
"sroffset": 10,
"continue": "-||"
},
"query": {
"searchinfo": {
"totalhits": 470,
"suggestion": "hastemplate:Infobox_musical_artist dart",
"suggestionsnippet": "hastemplate:Infobox_musical_artist <em>dart</em>"
},
"search": [
{
"ns": 0,
"title": "Daft Punk",
"snippet": "<span class=\"searchmatch\">Daft</span> Punk are an electronic music duo consisting of French musicians Guy-Manuel de Homem-Christo and Thomas Bangalter. The duo achieved significant popularity",
"size": 76278,
"wordcount": 8170,
"timestamp": "2016-02-08T01:33:54Z"
},
...
Here is a CodePen demo: http://codepen.io/slaporte/pen/obmaWY
It still may not capture 100% of the bands on Wikipedia. If there are specific subgenres you are looking for you, you can try using the hastemplate parameter along with links or categories to narrow or expand your search. You can learn more about the other Wikipedia CirrusSearch parameters here.
By the way, this is an interesting approach to autocomplete!