Visual

Blog post

Tweaks: Hide not translated documents from the content tree

21 June 2010, 1 comments
This post covers a tweak which I find useful when working with multiple cultures. The tweak hides documents which are not translated in the content tree. This can be usefull when you are working with a lot of documents/cultures or when you simply want to keep a clean content tree per culture.

You can find the code changes to enable this tweak below:
 

Modify lines 668-673 in CMSModules/Content/Controls/ContentTree.ascx.cs to:
if (childNodeId != nodeId)
{
    System.Web.UI.WebControls.TreeNode newNode = 
        CreateNode(childNode, index, true);

    // Do not add the node when null
    if (newNode != null)
    {
        e.Node.ChildNodes.Add(newNode);
        index++;
    }
}

Modify lines 743-476 in CMSModules/Content/Controls/ContentTree.ascx.cs to:
if (!translated)
{
    return null;
}

The image below displays the result of this tweak. In the left part of the image you can see the default Kentico tree with indicator images (x) for not translated documents. In the right part of the image you can see the tweaked and filtered content tree.

not_translated.jpg


Please note that this tweak is not fully tested and is not in anyway supported by Kentico. Don't hesitate to contact me if you have any questions/suggestions regarding the tweak.
Filed under: Culture, Tweaks, UI, 55

Comments
Nick Liembnn
super! came in very handy!
4/12/2011 5:44:37 PM
Leave comment



 Security code

Search

Related posts

API: Integrating the Google translate service

Last week we visited the HartmanEVENT 2011  in the Netherlands. This is were my boss attended the "Content Tool Idol 2011... read more

Exploring Kentico CMS 5.5 (Beta)

Just when you think you got 5.0 figured out, Kentico drops an early beta version of the upcoming 5.5 release. The beta... read more

Tweaks: Default web part container

This tweak will show you the needed steps for creating default web part containers per site. Step 1: Create a web part... read more

Tweaks: Widgetize!

This tweak will allow you to create configured widgets from your configured web parts. It works as follows. I have... read more

Tweaks: Copy web part

This tweak is similar to the "Widgetizer!" script and allows you to copy web parts from one page template to another... read more