Try our conversational search powered by Generative AI!

Category and their GUIDS

Vote:
 

Heya guys

I was just wondering is it possible to find a category by its GUID ?

i know you can find them by either name or ID although need something a bit more static.

Thanks


Minesh

#57466
Mar 15, 2012 11:23
Vote:
 

Seems like their is nothing out of the box and EPiServer suggested making my own method, using GetRoot and FindChild this was very quick to do and my extention method looks a little simething like this :

publicstaticCategory Find(thisCategory category, Guid guid)

{

CategoryCollection categoryCollection = category.Categories;

foreach (Category cat in categoryCollection)

{

if (cat.GUID == guid)

{

return cat;

}

return cat.Find(guid);

}

returnnull;

#57524
Mar 19, 2012 11:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.