How to check if a Property is marked as Searchable

by: Allan Thræn

A couple of times I've been asked how to check if a property on a page is set to be Searchable. It can be very handy to know, if you are making a search engine integration - or any other kind of textual processing of EPiServer CMS content, for that matter. And I know I haven't been alone in wondering why it's not exposed on the PropertyData object. However, the answer is simply, that it doesn't belong there. It's a piece of meta-data set on the definition on a property - and not on the property itself. In order words, it's one abstraction level above the PropertyData object.

To get access to the SearchAble, LanguageSpecific, etc properties look at the PageDefinition class - for instance like this:

PropertyData pd = CurrentPage.Property["MainBody"];
bool isSearchable = 
PageDefinition.Load(pd.PageDefinitionID).Searchable;

23 June 2008


Comments

  1. Works like a charm.
Post a comment    
User verification Image for user verification  
Allan Thræn

About me

I am a product manager @ EPiServer, with a passion for the more geeky side of things. My technical interests are typically focused around user problems, user experience,  search, information management, artificial intelligence and  personalization

On top of this blog I have the blog Allan On Technology and I often crosspost.

DISCLAIMER: Unless otherwise stated in the posts, this blog expresses my personal opinions, experiments and views, not necessarilly the views of EPiServer AB.

 44 page views this week.

 

 

Syndications


Archive


Tag cloud

EPiTrace logger