How do I get the name of a node for a specific language variant?
I'm trying to generate a list of child names based on the language variant of the current page via a backoffice api call, but I've run into a road block getting the language variant names of the children that allow varying language by culture. As a test, I've tried using
Model.Value("pageName", "en")
but this doesn't work, likely because "pageName" is no longer a valid reference for the node name. I also tried a few other flavors of that like "@pageName,""nodeName" and "@nodeName," but had no success. None of these worked when the language code was removed either.
I also tried getting at the name from the Cultures property, which does store the name. That property isn't publicly accessible though, so that is a no go as well.
Any ideas on how to get the name for a specific language from a node?
How do I get the name of a node for a specific language variant?
I'm trying to generate a list of child names based on the language variant of the current page via a backoffice api call, but I've run into a road block getting the language variant names of the children that allow varying language by culture. As a test, I've tried using
but this doesn't work, likely because "pageName" is no longer a valid reference for the node name. I also tried a few other flavors of that like "@pageName," "nodeName" and "@nodeName," but had no success. None of these worked when the language code was removed either.
I also tried getting at the name from the Cultures property, which does store the name. That property isn't publicly accessible though, so that is a no go as well.
Any ideas on how to get the name for a specific language from a node?
Hi Jesse
Looking here:
https://github.com/umbraco/Umbraco-CMS/blob/27223738c6af045b637bb9944b53134e681ce5e5/src/Umbraco.Core/PublishedContentExtensions.cs#L48
I'm thinking it might be a change to the usual Name property to allow a culture to be passed in...
... thinking something like this
might be what you are after?
regards
Marc
Thanks Marc,
That's exactly what I was after. I didn't realize "Name" also doubled as a method call.
:-) t's only very recently that it has become one!
is working on a reply...