Searches.GetByGuid
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Searches.GetByGuid

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Lta
Guest





Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Searches.GetByGuid Reply with quote

Hi,

I am creating a site's navigation and am setting the rootChannel by using
Searches.GetByGuid which I have read is the most efficient and reliable.

The search returns an HierarchyItem object.

How do I convert this object to a Channel object that I can then use to
create the navigation?

Thanks

John
Back to top
Lta
Guest





Posted: Tue Oct 18, 2005 4:51 pm    Post subject: RE: Searches.GetByGuid Reply with quote

Found it...

Channel c = CmsHttpContext.Current.Searches.GetByGuid(Guid) as Channel;

"as Channel" was the magic!

"Lta" wrote:

Quote:
Hi,

I am creating a site's navigation and am setting the rootChannel by using
Searches.GetByGuid which I have read is the most efficient and reliable.

The search returns an HierarchyItem object.

How do I convert this object to a Channel object that I can then use to
create the navigation?

Thanks

John
Back to top
Dangeriz
Guest





Posted: Mon Nov 07, 2005 5:50 pm    Post subject: RE: Searches.GetByGuid Reply with quote

You can also "cast" the HierarchyItem like this:

Channel c = (Channel) CmsHttpContext.Current.Searches.GetByGuid(Guid);

similarly you can cast the HierarchyItems to other valid CMS objects which
are:

Posting, Template, TemplateGallery, Resource, ResourceGallery.

--
Dangeriz


"Lta" wrote:

Quote:
Found it...

Channel c = CmsHttpContext.Current.Searches.GetByGuid(Guid) as Channel;

"as Channel" was the magic!

"Lta" wrote:

Hi,

I am creating a site's navigation and am setting the rootChannel by using
Searches.GetByGuid which I have read is the most efficient and reliable.

The search returns an HierarchyItem object.

How do I convert this object to a Channel object that I can then use to
create the navigation?

Thanks

John
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB