Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have created a new section in Umbraco back office where I created a folder with 2 nodes - each going to a different page:
* First Page
* Second Page
I created these based on the tutorial here: http://www.nibble.be/?p=71 and here: http://abrissirba.wordpress.com/2012/12/09/custom-section-in-umbraco-back-office/
Basically in RenderJS I append 2 above pages to display in the left hand side tree of my section.
They firstly display fine then when I go somewhere else in the CMS and go back to the section the page names on each link are dupliacted, eg:
* First PageSecond Page
When I go again and come back to the section they are further duplicated, eg:
* First PageSecond PageFirst PageSecond Page
The script is clearly adding the names instead of replacing them each time but I don't know what to change to fix it.
Anyone has idea what I shall do? Thanks
here is my code:
namespace MyRequests.Trees
{
public class LoadCustomTree : BaseTree
public LoadCustomTree(string application) : base(application) { }
protected override void CreateRootNode(ref XmlTreeNode rootNode)
rootNode.Icon = FolderIcon;
rootNode.OpenIcon = FolderIconOpen;
rootNode.NodeType = "init" + TreeAlias;
rootNode.NodeID = "init";
}
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.Add(ActionRefresh.Instance);
actions.Add(ActionDelete.Instance);
public override void Render(ref XmlTree tree)
XmlTreeNode nodeRequests = XmlTreeNode.Create(this);
nodeRequests.NodeID = "1";
nodeRequests.Text = "Policy Requests";
nodeRequests.Action = "javascript:openRequests('" + "1" + "');";
nodeRequests.Icon = "doc.gif";
tree.Add(nodeRequests);
XmlTreeNode nodeFunds = XmlTreeNode.Create(this);
nodeFunds.NodeID = "1";
nodeFunds.Text = "Funds Upload";
nodeFunds.Action = "javascript:openFunds('" + "1" + "');";
nodeFunds.Icon = "doc.gif";
tree.Add(nodeFunds);
public override void RenderJS(ref StringBuilder Javascript)
Javascript.Append(
@"
function openRequests(id) {
parent.right.document.location.href = 'RM/editRMRequests.aspx?id=' + id;
");
function openFunds(id) {
parent.right.document.location.href = 'RM/editRMPage.aspx?id=' + id;
Hi Eva
Could you post a screendump of what it looks like in the Umbraco backoffice? And what version of Umbraco are you using?
/Jan
Also, try making sure each of your tree nodes has a unique ID (I notice you assign '1' in both nodes above).
The id doesn't matter as it is not caught in aspx scripts.
Here are the screenshots:
Correct view - this displays only when first time in the section after login
Second view after coming back to the section
Third view after coming back to the section again
Any ideas on this? Still cannot make it working properly :(
Resolved :)
I had set
nodeFunds.NodeID="1";
for all tree nodes, each has to have different id of course
You got it - you do need to set the Node ID for each node to avoid this, otherwise I think there's some ID/Class conflicts causing this issue. Glad that worked!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
custom section tree item name duplicated
Hi,
I have created a new section in Umbraco back office where I created a folder with 2 nodes - each going to a different page:
* First Page
* Second Page
I created these based on the tutorial here: http://www.nibble.be/?p=71 and here: http://abrissirba.wordpress.com/2012/12/09/custom-section-in-umbraco-back-office/
Basically in RenderJS I append 2 above pages to display in the left hand side tree of my section.
They firstly display fine then when I go somewhere else in the CMS and go back to the section the page names on each link are dupliacted, eg:
* First PageSecond Page
* First PageSecond Page
When I go again and come back to the section they are further duplicated, eg:
* First PageSecond PageFirst PageSecond Page
* First PageSecond PageFirst PageSecond Page
The script is clearly adding the names instead of replacing them each time but I don't know what to change to fix it.
Anyone has idea what I shall do? Thanks
here is my code:
Hi Eva
Could you post a screendump of what it looks like in the Umbraco backoffice? And what version of Umbraco are you using?
/Jan
Also, try making sure each of your tree nodes has a unique ID (I notice you assign '1' in both nodes above).
The id doesn't matter as it is not caught in aspx scripts.
Here are the screenshots:
Correct view - this displays only when first time in the section after login
Second view after coming back to the section
Third view after coming back to the section again
Any ideas on this? Still cannot make it working properly :(
Resolved :)
I had set
for all tree nodes, each has to have different id of course
You got it - you do need to set the Node ID for each node to avoid this, otherwise I think there's some ID/Class conflicts causing this issue. Glad that worked!
is working on a reply...