hi, I have made a small umbraco 11 project, that I just made from sratch, with the starter template. I then added a small homepage, and gave it two domains with the same language
and I then made this small snippet to get the node, and the url for the node:
var content = umbracoContextReference.UmbracoContext.Content;
IPublishedContent? res = content.GetById(pageId);
var url =res.Url();
and this always gets the url which is the lastly added one (the bottom one)
But I would like to be able to get the see both of the url's, which in my understanding both are mapped to the node. So that I can pick the one that is fitting.
Getting domain for specific node in code
hi, I have made a small umbraco 11 project, that I just made from sratch, with the starter template. I then added a small homepage, and gave it two domains with the same language
and I then made this small snippet to get the node, and the url for the node:
and this always gets the url which is the lastly added one (the bottom one)
But I would like to be able to get the see both of the url's, which in my understanding both are mapped to the node. So that I can pick the one that is fitting.
While googling, I found this question which uses:
but this did seem to be deprecated, and I also could'nt make the ApplicationContext solution work mentioned in the comments
Is there something equivalent to GetDomainsById I can use, or some other way that I can get all domains for a given IPublishedContent?
Best regards :)
EDIT:
If I change the culture/language to something another language like danish, then I am able to target the url with that specific culture like so:
But when the domains have the same culture, this is not doable
is working on a reply...