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
I need to check the assigned hostname(s) in a datatype.
Any simple way of getting this?
There is an API method to get all the domains for the current page/node:
umbraco.library.GetCurrentDomains(int NodeId)
Cheers, Lee.
or if you want all the domains, then try the following method:
umbraco.cms.businesslogic.web.Domain.GetDomains()
That will return a List<Domain> collection.
Thanks for your extremely quick reply Lee!
Nik
Hi Lee,
I can't find a method like Domain.GetDomains() in umbraco.cms.businesslogic.web.
Mahesh
GetDomains() is an internal method.
Here's the code:
internal static List<Domain> GetDomains() { return Cache.GetCacheItem<List<Domain>>("UmbracoDomainList", getDomainsSyncLock, TimeSpan.FromMinutes(30.0), delegate { List<Domain> list = new List<Domain>(); using (IRecordsReader reader = SqlHelper.ExecuteReader("select id, domainName from umbracoDomains", new IParameter[0])) { while (reader.Read()) { string domainName = reader.GetString("domainName"); int id = reader.GetInt("id"); if (list.Find(d => d.Name == domainName) == null) { list.Add(new Domain(id)); } else { Log.Add(LogTypes.Error, User.GetUser(0), -1, string.Format("Domain already exists in list ({0})", domainName)); } } } return list; }); }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
get hostname(s)
I need to check the assigned hostname(s) in a datatype.
Any simple way of getting this?
There is an API method to get all the domains for the current page/node:
Cheers, Lee.
or if you want all the domains, then try the following method:
That will return a List<Domain> collection.
Cheers, Lee.
Thanks for your extremely quick reply Lee!
Nik
Hi Lee,
I can't find a method like Domain.GetDomains() in umbraco.cms.businesslogic.web.
Mahesh
GetDomains() is an internal method.
Here's the code:
is working on a reply...