You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that, when I do have a /fr prefix in my route, that prefix is sent to SEOmatic via the uri parameter (see screenshot below), and because of this SEOmatic cannot find the related entry. Craft does not include the language in the URIs of the pages. When I remove this prefix manually, it works.
This is what I did (in a simplified version) to make it work:
let fullPath = route.fullPath;
if (fullPath.startsWith('/fr')) {
fullPath = route.fullPath.replace('/fr/', '/');
}
return await app.seomaticMeta({ fullPath }, siteId);
I guess we can agree this is not a sustainable solution. Is there a way (with the current methods/configuration elements) to indicate to the plugin the languages to remove from the path for all the pages? Would it be possible to implement that feature otherwise?
The text was updated successfully, but these errors were encountered:
@maximepalau@ben-rogerson I am trying to do the same - did you find a solution for this? I also have another issue related - how would I get the siteId from the siteHandle (eg fr)? the only data I will have to determine which site I am on is from the locale/handle so there's no way of me knowing what the ID is.
async asyncData (context) {
const siteHandle = context.app.i18n.locale;
const siteId = 1; // how do I get the siteId from the siteHandle?
return {
headData: await context.app.seomaticMeta(context.route, siteId),
}
},
Great question, I'd like to know this too.
A quick google brings this function: craft.app.getSites().getSiteByHandle('handle')
But the I wonder how you'd grab that from within nuxt?
Hi,
I'm experiencing an issue with the multisite logic.
I’m using nuxt-i18n to manage the languages of my application. For a same page in two different languages, the URLs are like the following:
The issue is that, when I do have a
/fr
prefix in my route, that prefix is sent to SEOmatic via theuri
parameter (see screenshot below), and because of this SEOmatic cannot find the related entry. Craft does not include the language in the URIs of the pages. When I remove this prefix manually, it works.This is what I did (in a simplified version) to make it work:
I guess we can agree this is not a sustainable solution. Is there a way (with the current methods/configuration elements) to indicate to the plugin the languages to remove from the path for all the pages? Would it be possible to implement that feature otherwise?
The text was updated successfully, but these errors were encountered: