November Happy Hour will be moved to Thursday December 5th.

How do i get only visible Categories?

Vote:
 

Hi

 

I'm trying to select categories under a certain categoryparent to display in a dropdown. This works except to filter out the categories that are marked as not visible in admin mode.

What should i do to filter out not visible categories?

Here's the code so far:

Category treatmentParent;

treatmentParent = Category.Find(Configuration.CompanySection.Instance.Settings.TreatmentCategoryId);

ucTreatmentSelect.DataTextField = "Description";
ucTreatmentSelect.DataValueField = "Name";

ucTreatmentSelect.DataSource = TranslateCategories(treatmentParent.Categories);
DataBind();

ucTreatmentSelect.Items.Insert(0, Translate("/categories/treatment"));
 
/Jonas

 

#51268
May 31, 2011 9:29
Vote:
 

what looping over the categories and check if they are visible?

#51274
May 31, 2011 11:32
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.