Copied to clipboard

Flag this post as spam?

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


  • prl 32 posts 54 karma points
    Jul 20, 2010 @ 20:37
    prl
    0

    Adding a tray icon - problem

    Hello, I'm trying to add a custom tray icon for a backoffice. My project is in VB and I followed this tutorial:

    http://www.geckonewmedia.com/blog/2009/8/3/how-to-create-a-custom-section-in-umbraco-4

    The problem is: I successfully added the Backoffice icon to the tray, but when I click on it no nodes are added for the .aspx page I created. Here's the code I used:

    Imports umbraco.cms.presentation.Trees
    Imports System.Text
    
    Public Class CustomTree
        Inherits BaseTree
    
        Public Sub New(ByVal application As String)
            MyBase.New(application)
        End Sub
    
        Protected Overrides Sub CreateRootNode(ByRef rootNode As XmlTreeNode)
            rootNode.Icon = FolderIcon
            rootNode.OpenIcon = FolderIconOpen
            rootNode.NodeType = ("init" & MyBase.TreeAlias)
            rootNode.NodeID = "init"
        End Sub
    
        Public Overrides Sub Render(ByRef tree As XmlTree)
            Dim newNode As XmlTreeNode
    
            ' Create tree node to allow sending a newsletter
            newNode = XmlTreeNode.Create(Me)
            newNode.Text = "Polls"
    newNode.Icon = "statistik.gif" newNode.Action = "javascript:openPolls()" ' Add the node to the tree tree.Add(newNode) End Sub Public Overrides Sub RenderJS(ByRef javascript As StringBuilder) javascript.Append("function openPolls() { parent.right.document.location.href = '/backend/PollsList.aspx'; } ")
    End Sub End Class

     

    I added the following values to the UmbracoApp table: 

    sortOrder: 9
    appAlias: backoffice
    appIcon: backoffice.gif
    appName: Backoffice
    appInitWithTreeAlias: NULL

    And to the UmbracoAppTree:

    treeSilent: False
    treeInitialize: True
    treeSortOrder: 0
    appAlias: backoffice
    treeAlias: backoffice
    treeTitle: Backoffice
    treeIconClosed: folder.gif
    treeIconOpen: folder_o.gif
    treeHandlerAssembly: Project.Umbraco.backend
    treeHandlerType: CustomTree
    action: NULL

    Gave permission to the user to see the "backoffice" icon on the tray. I can see the icon but when I click on it only the node "Backoffice" is visible but I have no node "Polls". What can be the problem here?

    Thanks in advance

Please Sign in or register to post replies

Write your reply to:

Draft