Try our conversational search powered by Generative AI!

How do i get only visible Categories?




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);

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


May 31, 2011 9:29

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

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.