Unable to retrieve data from Vorto with GetVortoValue.
Hi there.
I'm trying to use Vorto but after having installed it I'm running into some troubles. The HasVortoValue and GetVortoValue extensions do not work as expected.
I'm trying to use HasVortoValue like this:
var something = somethingElse.HasVortoValue("markerText");
And even though somethingElse has a property with the propertyTypeAlias "markerText" and values {[en, English text from Vorto ]} and {[is, Icelandic text from Vorto]}, HasVortoValue still returns false and
var markerText = somethingElse.GetVortoValue("markerText");
returns null. In other words, it looks like the data is present but I am not able to retrieve it. Hope this makes sense, this is the first time I'm using Vorto :)
I'm actually looping through IPublishedContent nodes so somethingElse is of type IPublishedContent. Nevertheless I did try to assign somethingElse to a variable of type IPublishedContent but I'm getting the same results.
Actually, it's ok that GetCulture returns the Icelandic culture info.
At least, the culture for that node is known and is as expected.
So far, it looks like the published somethingElse node for which GetVortoValue is called really does not have any translated text defined for the property with alias markerText.
Next step would be to check if the latest changes, especially with regards to the translations, have been published.
Another thing to try, is to inspect the somethingElse node (for example the .Path and .Level property) to see if you are really looking at the node you expect to look at.
Maybe you can share some code that shows how you obtain somethingElse?
When you've been staring at the same code for so long you tend to miss the little things. I did not realize Iceland had two different culture codes (it doesn't make a lot of sense either).
Unable to retrieve data from Vorto with GetVortoValue.
Hi there.
I'm trying to use Vorto but after having installed it I'm running into some troubles. The HasVortoValue and GetVortoValue extensions do not work as expected.
I'm trying to use HasVortoValue like this:
And even though somethingElse has a property with the propertyTypeAlias "markerText" and values {[en, English text from Vorto ]} and {[is, Icelandic text from Vorto]}, HasVortoValue still returns false and
returns null. In other words, it looks like the data is present but I am not able to retrieve it. Hope this makes sense, this is the first time I'm using Vorto :)
HasVortoValue and GetVortoValue are extensions for IPublishedContent.
If you cast somethingElse to IPublishedContent and then call HasVortoValue/GetVortoValue on that PublishedContent, I think it will work.
Hi Micha, thanks for the reply.
I'm actually looping through IPublishedContent nodes so somethingElse is of type IPublishedContent. Nevertheless I did try to assign somethingElse to a variable of type IPublishedContent but I'm getting the same results.
Others, that have experienced similar problems, have suggested that Vorto behaves this way if the values language I'm trying to retrieve does not correspond to the current culture of my project (f.x. if my current culture is en-US and the Vorto value I'm trying to retrieve does not have a value for that language). See: https://our.umbraco.org/projects/backoffice-extensions/vorto/bugs-feedback-suggestions/52887-GetVortoValue(propertyName)-returning-null#comment-183955
So I tried to manually set the current culture of the thread to icelandic like so:
I have also tried to use the cultureName variable of the GetVortoValue extension like so:
That does not seem to work either :/
It is remarkable that calling
did not work ...
What kind of culture info result do you get when calling:
Further, I wonder if your property is defined on several levels, having it filled in on only one of these levels?
If so, can you try to set the recursive parameter of GetVortoValue to true?
I'm getting the Icelandic culture info when I call
I would expect "Icelandic text from Vorto" to be returned.
Actually, it's ok that GetCulture returns the Icelandic culture info. At least, the culture for that node is known and is as expected.
So far, it looks like the published somethingElse node for which GetVortoValue is called really does not have any translated text defined for the property with alias markerText.
Next step would be to check if the latest changes, especially with regards to the translations, have been published.
Another thing to try, is to inspect the somethingElse node (for example the .Path and .Level property) to see if you are really looking at the node you expect to look at.
Maybe you can share some code that shows how you obtain somethingElse?
Hi there,
Could you try an post the result of:
Hi Rasmus.
returns
Just so everything is completely clear, this is what I'm doing exactly:
I am not using Vorto in a Razor view, I'm using it in the method that constructs the GEOJson object. I'm not sure if that was clear :)
Hi Ivar,
It seems like you are trying to get the Icelandic text using "is-IS" and not "is" as the result here suggest:
Could you try the following:
When you've been staring at the same code for so long you tend to miss the little things. I did not realize Iceland had two different culture codes (it doesn't make a lot of sense either).
Thanks for the help :D
is working on a reply...