Closed ing-ivan-31 closed 2 years ago
The first thing I would suggest it to update to the latest version, which is Version 3.4.37 as of this writing.
Also, I notice that you're using the JSON-LD endpoint, but you're not passing in a siteId
parameter? Doing so will cause it to just return the default site's metadata.
https://nystudio107.com/docs/seomatic/advanced.html#meta-container-api-endpoints
@khalwat, the issue persists on my environment with the version 3.4.37 and also adding the siteId parameter,
Did you fill in different information for each site in SEOmatic -> Site Settings?
Hi again @khalwat, thanks for the help and answers, related to your last question, I fill in all the different information for each site but I continue with the same problem, below some evidence:
So I just did a test, and it seems to be working as expected.
I tried two simple tests:
URL #1: http://localhost:8003/actions/seomatic/meta-container/meta-json-ld-container/?uri=/&siteId=1
Output #1:
{
"MetaJsonLdContainer": "<script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"WebPage\",\"author\":{\"@id\":\"#identity\"},\"copyrightHolder\":{\"@id\":\"#identity\"},\"copyrightYear\":\"2020\",\"creator\":{\"@id\":\"#creator\"},\"dateModified\":\"2021-03-15T11:40:42-04:00\",\"datePublished\":\"2020-03-27T09:38:00-04:00\",\"headline\":\"Homepage\",\"image\":{\"@type\":\"ImageObject\",\"url\":\"http://localhost:8003/assets/site/_1200x630_crop_center-center_82_none/Screen-Shot-2022-03-22-at-12.56.42-PM.png?mtime=1650309044\"},\"inLanguage\":\"en-us\",\"mainEntityOfPage\":\"http://localhost:8003/\",\"name\":\"Homepage\",\"publisher\":{\"@id\":\"#creator\"},\"url\":\"http://localhost:8003\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@id\":\"#identity\",\"@type\":\"LocalBusiness\",\"priceRange\":\"$\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@id\":\"https://nystudio107.com/#creator\",\"@type\":\"Organization\",\"address\":{\"@type\":\"PostalAddress\",\"addressCountry\":\"US\",\"addressLocality\":\"Webster\",\"addressRegion\":\"NY\",\"postalCode\":\"14580\"},\"alternateName\":\"nys\",\"description\":\"We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO\",\"email\":\"info@nystudio107.com\",\"founder\":\"Andrew Welch, Polly Welch\",\"foundingDate\":\"2013-05-02\",\"foundingLocation\":\"Webster, NY\",\"image\":{\"@type\":\"ImageObject\",\"height\":\"1042\",\"url\":\"https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png\",\"width\":\"1042\"},\"name\":\"nystudio107\",\"url\":\"https://nystudio107.com\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"BreadcrumbList\",\"description\":\"Breadcrumbs list\",\"itemListElement\":[{\"@type\":\"ListItem\",\"item\":\"http://localhost:8003\",\"name\":\"Homepage\",\"position\":1}],\"name\":\"Breadcrumbs\"}</script>"
}
URL #2: http://localhost:8003/actions/seomatic/meta-container/meta-json-ld-container/?uri=/&siteId=2
Outpu #2t:
{
"MetaJsonLdContainer": "<script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"WebPage\",\"author\":{\"@id\":\"#identity\"},\"copyrightHolder\":{\"@id\":\"#identity\"},\"copyrightYear\":\"2020\",\"creator\":{\"@id\":\"#creator\"},\"dateModified\":\"2021-03-15T11:40:42-04:00\",\"datePublished\":\"2020-03-27T09:38:00-04:00\",\"headline\":\"Homepage\",\"inLanguage\":\"es\",\"mainEntityOfPage\":\"http://localhost:8003/es/\",\"name\":\"Homepage\",\"publisher\":{\"@id\":\"#creator\"},\"url\":\"http://localhost:8003/es\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@id\":\"#identity\",\"@type\":\"LocalBusiness\",\"priceRange\":\"$\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@id\":\"https://nystudio107.com/#creator\",\"@type\":\"Organization\",\"address\":{\"@type\":\"PostalAddress\",\"addressCountry\":\"US\",\"addressLocality\":\"Webster\",\"addressRegion\":\"NY\",\"postalCode\":\"14580\"},\"alternateName\":\"nys\",\"description\":\"We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO\",\"email\":\"info@nystudio107.com\",\"founder\":\"Andrew Welch, Polly Welch\",\"foundingDate\":\"2013-05-02\",\"foundingLocation\":\"Webster, NY\",\"image\":{\"@type\":\"ImageObject\",\"height\":\"1042\",\"url\":\"https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png\",\"width\":\"1042\"},\"name\":\"nystudio107\",\"url\":\"https://nystudio107.com\"}</script><script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"BreadcrumbList\",\"description\":\"Breadcrumbs list\",\"itemListElement\":[{\"@type\":\"ListItem\",\"item\":\"http://localhost:8003/es\",\"name\":\"Homepage\",\"position\":1}],\"name\":\"Breadcrumbs\"}</script>"
}
I know it's a little hard to read, but you'll see the different URLs, and two different titles: Project ENGLISH and Project SPANISH
Have you tried clearing SEOmatic's caches, or hitting the endpoints directly to see what you see there?
Hi ing-ivan-31, I think you need to update the DynamicMeta.php file following this lines because right now getElementByUri function is hardcoded with__home__
and that uri doesn't exist
Line 282
self::addMetaJsonLdBreadCrumbs($siteId, $uri);
line 314
public static function addMetaJsonLdBreadCrumbs(int $siteId = null, string $uri = '')
line 348
$element = Craft::$app->getElements()->getElementByUri($uri, $siteId, true);
Hi ing-ivan-31, I think you need to update the DynamicMeta.php file following this lines because right now getElementByUri function is hardcoded with
__home__
and that uri doesn't existLine 282
self::addMetaJsonLdBreadCrumbs($siteId, $uri);
line 314public static function addMetaJsonLdBreadCrumbs(int $siteId = null, string $uri = '')
line 348$element = Craft::$app->getElements()->getElementByUri($uri, $siteId, true);
@khalwat what do you think about this? , i made the test for only homepage in each site id and effectively the url change but when i enter other URI only i am getting the homepage check the screenshots
So you have no element that is designated as being the homepage of the site (it would have the special URI of __home__
), whether that be a single or an entry in a structure or the like?
If not, then SEOmatic can't automatically determine the home page properly for you.
So you have no element that is designated as being the homepage of the site (it would have the special URI of
__home__
), whether that be a single or an entry in a structure or the like?If not, then SEOmatic can't automatically determine the home page properly for you.
You have right @khalwat, the homepage is missing on our craft configuration when i set the homepage all the breadcrumb lists started to work on our pages.
thank so much, for your help and support.
Question
Hello,
I have a Craftcms3 project with a multiple sites setup like this (they are all in the same single group):
My problem when i am trying to get the breadcrumbs only i am getting the homepage on the items, this is happening for all the pages
I don't know if I am missing something on the configuration of seomatic, the seomatic version used is 3.4.22
Additional context