Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Hide certain Document Types from CMS Site Tree? View modes: 
User avatar
Member
Member
markcoatsworth - 4/27/2011 2:37:49 PM
   
Hide certain Document Types from CMS Site Tree?
I'm working on a project for a client deals with a large amount of data. Their site contains 200+ pages, and each page contains a series of news articles. There are 7,000+ news articles in total.

I've created a custom document type for these news articles, and I've imported all their data into Kentico. Needless to say, CMS Desk is a mess! The site tree contains thousands of items and it's impossible to browse.

I've modified the Content module to add a tab to pages that shows all child news articles. That works great. But the documents still appear in the site tree and it's very difficult to navigate. Is it possible to hide them from the tree?

If this is not possible, can you suggest another way to effectively manage this many documents? Would I be better off using custom tables for this?

Thanks for your help!

Mark

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 4/27/2011 3:28:50 PM
   
RE:Hide certain Document Types from CMS Site Tree?
Hi Mark,


the custom tables could be a solution because of huge amount of data.

If you want to use documents, I would recommend you using List mode (next to Edit, Preview and Live site mode). You can sort and filter the children documents easily there. You can also decrease the number of displayed documents in the content tree in:

Site manager -> Settings -> Content management -> Max tree nodes


Best regards,
Helena Grulichova

User avatar
Member
Member
markcoatsworth - 4/27/2011 10:26:35 PM
   
RE:Hide certain Document Types from CMS Site Tree?
Thanks for your help Helen!

It looks like custom tables are not going to work. The news articles appear in two different cultures. From what I can see custom tables do not support multiple cultures.

Also some of the news articles will require PDF attachments so I'd really like to use regular documents for these.

We could limit the number of displayed documents like you suggested, but the problem is we also have to display regular pages (CMS.MenuItem types) and some other document types. We want all the pages to appear in the content tree.

Is there any way we can hide specific document types from the content tree?


User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 4/28/2011 7:28:55 AM
   
RE:Hide certain Document Types from CMS Site Tree?
Hi Mark,


You could re-write CMSDesk. If you open the file:

~\CMSModules\Content\Controls\ContentTree.ascx.cs

You can add a Where condition to the Page_Load method like:

mMapProvider.WhereCondition = "NodeClassID != 1685";

which will hide the CMS.File documents in my case (you can check ID in the CMS_Class table).

Please note that the expand icon is displayed according to count of children documents (the NodeChildNodesCount property). If you add the Where condition, it can display the "plus" icon incorrectly if there are only CMS.File documents underneath the parent node.


Best regards,
Helena Grulichova

User avatar
Member
Member
markcoatsworth - 4/28/2011 9:29:17 AM
   
RE:Hide certain Document Types from CMS Site Tree?
Thanks Helena! This is perfect. I didn't realize there was a separate control for the Content Tree.

I just tried this and it works perfectly. There are a few other small things I'll need to change in CMSDesk. But overall this is a great solution and it's much less work than the alternatives.

Thanks again!

Mark