Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brad 94 posts 151 karma points
    Mar 11, 2013 @ 05:59
    Brad
    1

    Creating a custom section in Umbraco 6?

     

    How do I add a custom section to Umbraco 6?

    I've looked at the videos in Umbraco TV that pertain to adding a custom section but these video describe an older version of Umbraco. One were the section info started in a DB table called UmbracoApp. That table and method no longer exists.

    All I know already is that the Config/application.config file is where you start in these newer releases of Umbraco.

    But there has to be more to it than that? Where is this documented? Where are the tutorials? Why do I pay for Umbraco TV when the videos I need are not relevent to the current release of the product? I'd understand some feet dragging if the videos were free. But I'm paying for them!

    Can anyone point me to a tutorial on adding a custom section/tress etc in Umbraco 6?

     

  • Radek 10 posts 51 karma points
    Mar 11, 2013 @ 10:53
    Radek
    101

    Hi Brad,

    I think you should check this blog: creating-custom-applications-and-trees-in-umbraco-4-8 (great job, Matt!)

    The points of your attention should be /config/trees.config and /config/applications.config files.

    Radek

  • Brad 94 posts 151 karma points
    Mar 11, 2013 @ 23:22
    Brad
    0

    Thank you Radek.. That looks like what I am after. Getting into it now. .

     

  • Paul Sørensen 304 posts 650 karma points
    Mar 31, 2013 @ 17:47
    Paul Sørensen
    0

    Hi

    Link is broken - what a pity

    /Paul S

  • Paul Sørensen 304 posts 650 karma points
    Mar 31, 2013 @ 17:51
  • Adrian Inman 35 posts 59 karma points
    Jul 17, 2013 @ 15:30
    Adrian Inman
    0

    ARGH! Where is there good documentation on this?

    I have found a tutoral on Umbraco 4.11, but not that when you create the Application and Tree classes, the applications.config and trees.config files are automatically populated with entries, but the section still doesn't show in the admin panel.

    Ah!

    I have found one part at least - I need to turn on access in the user's section part of the admin. Have done that, but still get no icon :(

  • Martin Lingstuyl 202 posts 379 karma points
    Aug 16, 2013 @ 16:54
    Martin Lingstuyl
    0

    so, did you solve the puzzle already? maybe otherwise send me the code. i can have a look. 

     

    btw. if you see the section in the users permissions, you  should see the section icon in the sections div as well. so which icon arent you seeing?

  • Zac 223 posts 575 karma points
    Aug 29, 2013 @ 16:21
    Zac
    0

    Adding an application to the application.config and trees.config has resulted in no change in the user permissions section.

    The new application hasn't registered

    Umbraco 6.1.14

  • Martin Lingstuyl 202 posts 379 karma points
    Aug 29, 2013 @ 17:00
    Martin Lingstuyl
    0

    Tried restarting the application pool? Also you might have referenced the namespace/assembly wrong in the applications.config.

  • Zac 223 posts 575 karma points
    Aug 29, 2013 @ 17:10
    Zac
    0

    I'm trying to add a "dictionary" application, with the exact same functionality as the dictionary element within settings, but accessible for users without access to settings.

    To debug, I've tried just duplicating an existing application:

      <add alias="member2" name="Members 2" icon=".traymember" sortOrder="9" />
    

    And in trees.config:

        <add application="member2" alias="member2" title="Members 2" type="umbraco.loadMembers, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
    

    This is a duplicate of an existing entry.

    And indeed, I've been resetting the app pool (the old turn it off and turn it on again!) and it doesn't work.

  • Martin Lingstuyl 202 posts 379 karma points
    Aug 29, 2013 @ 19:40
    Martin Lingstuyl
    0

    Jeroen Breuer once made a package that does the same thing. Whether it works in Umbraco 6 I don't know.

    http://our.umbraco.org/projects/backoffice-extensions/digibiz-dictionary-section

     

    As to your codes I compared yours to mine which are:

    Application:  

    <add alias="agenda" name="Agendabeheer" icon="agenda_icon.png" sortOrder="8" />

    And Trees:

    <add silent="false" initialize="true" sortOrder="0" alias="agenda" application="agenda" title="Agendabeheer" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="AgendaSection.Trees.LoadCustomTree, AgendaSection" action="" />

    I notice I have the

    silent="false" initialize="true" 

    attributes and you have not. Might be those that are needed.

     

     

     

     

  • Zac 223 posts 575 karma points
    Aug 30, 2013 @ 11:16
    Zac
    0

    Thanks for taking the time to reply. I did consider that those attributes might be necessary but adding them didn't seem to help.

    I did see the digibiz package but was put off by reports of some issues and the author saying he currently used a different package!

  • Martin Lingstuyl 202 posts 379 karma points
    Aug 30, 2013 @ 11:38
    Martin Lingstuyl
    0

    What you might do is add a real custom section, instead of re-using an umbraco section. I think somethings going on there that might break your trying to use it separately.

    For example. Add the following code in a cs file to your app_code directory and reference it in the trees/applications files, and you'll see a new section show up in the users section. I tried it out here. It works. (though the populated nodes weren't visible, but thats a small issue)

    trees.config

    <add silent="false" initialize="true" sortOrder="0" alias="testsection" application="testsection" title="TestSection" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="TestSection.Trees.TestSection, TestSection" action="" />

    applications.config

    <add alias="testsection" name="TestSection" icon=".traycontent" sortOrder="8" />

    .cs file for app_code directory

    using System;
    using System.Collections.Generic;
    using System.Web;
    using umbraco.cms.presentation.Trees;
    using umbraco.BusinessLogic.Actions;
    using umbraco.interfaces;
    using System.Text;
    using umbraco.businesslogic;
    using Umbraco.Core.Persistence;
    using Umbraco.Core;

    namespace TestSection.Trees
    {
        [Tree("testsection", "testsection", "TestSection admin")]
        public class TestSection : BaseTree
        {
            private UmbracoDatabase _db = null;

            public TestSection(string application) : base(application) {
                _db = ApplicationContext.Current.DatabaseContext.Database;
            }



            protected override void CreateRootNode(ref XmlTreeNode rootNode)
            {           
                rootNode.NodeType = "init" + TreeAlias;
                rootNode.NodeID = "-1";
                rootNode.Text = "TestSection admin";
                rootNode.Menu.Clear();
                rootNode.Menu.AddRange(new List<IAction> { ActionRefresh.Instance });
            }

            protected override void CreateRootNodeActions(ref List<IAction> actions)
            {
                actions.Clear();
                //actions.Add(ActionNew.Instance);
                //actions.Add(ActionRefresh.Instance);
            }

            protected override void CreateAllowedActions(ref List<IAction> actions)
            {
                actions.Clear();
                actions.Add(ActionRefresh.Instance);
                actions.Add(ActionDelete.Instance);
               
            }

            public override void Render(ref XmlTree tree)
            {
                int id = 0;

                if (this.NodeKey == string.Empty)
                {

                    PopulateRootNodes(ref tree);

                }
                else
                {
                   
                }
            }

            /// <summary>
            /// Render the top Root Nodes.
            /// - Calendar -> The Root of all Calendars
            /// - Locations -> The Root of all Locations
            /// </summary>
            /// <param name="tree">The current tree</param>
            private void PopulateRootNodes(ref XmlTree tree)
            {
                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = "1";
                xNode.Text = "Node 1";
                //xNode.Action = "javascript:openCustom('" + "1" + "');";
                xNode.Icon = "date.png";
                xNode.OpenIcon = "folder_o.gif";
                xNode.NodeType = "ASTestBase";

                var treeService = new TreeService(-1, TreeAlias, ShowContextMenu, IsDialog, DialogMode, app, "ASTestBase");
                xNode.Source = treeService.GetServiceUrl();

                xNode.Menu.Clear();
                xNode.Menu.Add(ActionNew.Instance);
                xNode.Menu.Add(ActionRefresh.Instance);           

                tree.Add(xNode);

                xNode = XmlTreeNode.Create(this);
                xNode.NodeID = "2";
                xNode.Text = "Node 2";
                //xNode.Action = "javascript:openCustom('" + "1" + "');";
                xNode.Icon = "map.png";
                xNode.OpenIcon = "folder_o.gif";
                xNode.NodeType = "ASTestBase2";

                treeService = new TreeService(-1, TreeAlias, ShowContextMenu, IsDialog, DialogMode, app, "ASTestBase2");
                xNode.Source = treeService.GetServiceUrl();

                xNode.Menu.Clear();           
                xNode.Menu.Add(ActionNew.Instance);
                xNode.Menu.Add(ActionRefresh.Instance);

                tree.Add(xNode);

            }

            public override void RenderJS(ref StringBuilder Javascript)
            {
                Javascript.Append(
                   @"
                       
                       
                    ");

                  
            }
        }
    }

     

  • Michał Skuza 1 post 22 karma points
    Jan 10, 2014 @ 23:08
    Michał Skuza
    1

    Excuse me for diggin up the old thread, but what I've observed today is that only the admin-user created during installation can see custom applications in the "Sections" part of user management form. Even setting another user with Administrator role doesn't let him to see the custom applications privilege in "Sections". Umbraco version is 6.1.6

  • Zakhar 171 posts 397 karma points
    Mar 21, 2014 @ 18:30
    Zakhar
    0

    Michał Skuza, I've just tried that and didn't have any problems in v6.1.6. Works fine.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    May 05, 2014 @ 20:37
    Simon Dingley
    0

    I see the same as Michał Skuza in 6.1.6. I usually have to edit the umbracoUser2app table if the user I login with is not the one with the userId 1 e.g. the default admin user.

  • Radek 10 posts 51 karma points
    May 05, 2014 @ 21:10
    Radek
    0

    Yes, I can confirm this behaviour in 6.1.6. Only super admin (account created when installing Umbraco) can see custom sections and set them visible for other admins. Since then it is visible for them and they can manage it as well.

Please Sign in or register to post replies

Write your reply to:

Draft