Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
Is there away to know to which hostname the node I get is belong to?
My website is multilanguage so I get a list of nodes as the required node is under each site.
Regards,
mkariti
Ok I managed to do this:
public string HostName
{
get
var domains = umbraco.library.GetCurrentDomains(this.Id);
return domains[0].Name;
}
Is there any other way to get the hostname per node?
Cheers
Hi mkariti,
There's an extension method in uQuery (just include a "using umbraco;") called "GetFullNiceUrl" which can return the absolute URL for a node, but it does require a language (culture code) to be passed-through.
Otherwise your example is the way to do it.
Cheers, Lee.
Thanks Lee!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
uMapper - Node hostname
Hi there,
Is there away to know to which hostname the node I get is belong to?
My website is multilanguage so I get a list of nodes as the required node is under each site.
Regards,
mkariti
Ok I managed to do this:
public string HostName
{
get
{
var domains = umbraco.library.GetCurrentDomains(this.Id);
return domains[0].Name;
}
}
Is there any other way to get the hostname per node?
Cheers
mkariti
Hi mkariti,
There's an extension method in uQuery (just include a "using umbraco;") called "GetFullNiceUrl" which can return the absolute URL for a node, but it does require a language (culture code) to be passed-through.
Otherwise your example is the way to do it.
Cheers, Lee.
Thanks Lee!
is working on a reply...