seo-metadata
seo-metadata copied to clipboard
Please add Vorto support for URL_Names
like discussed:
https://our.umbraco.org/projects/backoffice-extensions/seo-metadata-for-umbraco/please-use-github-issues/64969-URL-rewrite
Had a little look into this at the minute. I'm not entirely sure this is currently possible as the current culture doesn't seem to be available at publish time to the IUrlSegmentProvider
(I need to dig into the core a little further to see what's up).
I'll spend a little more time on this tomorrow.
I've written a post on our.umbraco.org regarding these issues.
https://our.umbraco.org/forum/developers/api-questions/65242-UrlSegmentProviders-and-the-current-culture-(SEO-Metadata-playing-nice-with-Vorto)
At the moment the core doesn't make it possible for the UrlSegmentProvider to grab the current culture for the page with respect to I suspect that this won't be resolved soon, unfortunately.
What I'm considering doing is adding a boolean option to disable/enable the URL name renaming section being rendered. This will allow you to implement your own implementation of the URL segment provider using a standard textstring property and then use SEO Metadata with Vorto.
Hi Ryan Thank you for your help. Did you saw this post?
https://our.umbraco.org/projects/backoffice-extensions/vorto/bugs-feedback-suggestions/53831-Is-it-possible-to-use-vorto-with-umbracoUrlName
Maybe it could helping you...
I saw that and that's what I've been looking into. What Matt suggested is exactly what SEO Metadata is doing currently. Unfortunately that method cannot get the current culture so I cannot get the relevant version from the Vorto data.
You said you always receiving the same language "en-GB". I think this is your backend Users language, but if you logged out you couldn't get the right language at the frontend?
The request pipeline does. The problem is that you are configuring the URL name, which is a publishing/backoffice thing and not a content thing.
And something like that don't work?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Umbraco.Core.Strings; using Vorto.Extension
namespace ids.Umb.Mvc { public class LocalisedUrlSegmentProvider : IUrlSegmentProvider { readonly IUrlSegmentProvider _provider = new DefaultUrlSegmentProvider();
public string GetUrlSegment(Umbraco.Core.Models.IContentBase content, System.Globalization.CultureInfo culture)
{
string rVal = content.GetVortoValue<string>(URL_PropertyName, culture.ToString());
if (String.IsNullOrEmpty(rVal))
{
rVal = _provider.GetUrlSegment(content);
}
return rVal;
}
public string GetUrlSegment(Umbraco.Core.Models.IContentBase content)
{
return GetUrlSegment(content, System.Threading.Thread.CurrentThread.CurrentCulture);
}
}
}
GetVortoValue
is an extension method for IPublishedContent
, where content in this case is IContentBase
. The GetVortoValue()
method also uses Thread.CurrentThread.CurrentUICulture
.
GetVortoValue
is intended to be used at render time.
In that case it sounds bad :(
Looks like this issue will have to wait until v8 of the Core until it is resolved.
http://issues.umbraco.org/issue/U4-7130