New section and the tree Options
NeilG
Posted: Wednesday, July 02, 2008 5:07:32 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
Hi,

So close here! I've a new section called "Enquiries".

1. I've written a new class implementing the ITree and dropped the DLL in the "bin" folder.
2. I've made the "umbracoApp" & "umbracoAppTree" table updates to include my new section.
3. The tree appears great, as show below:

4. But, I don't want 2 "Enquiries" folders. Only one. I'm after something similar to the "Users" section:


Any ideas anyone. I've compared my new row with the User section rows in the db and just can't see what I've missed?


Neil



___________________________________________________________________________________

Neil
NeilG
Posted: Friday, July 04, 2008 1:37:50 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
Come on ... someone spill the beans!


___________________________________________________________________________________

Neil
imayat12
Posted: Friday, July 04, 2008 1:56:37 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Neil,

Have you tried look in the source for the itree filter dll that is called by umbraco in the user section?

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
NeilG
Posted: Saturday, July 05, 2008 9:13:40 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
Ismail,

ITree filter?
I thought it just called the "loadUsers" method in the "umbraco" dll, as set in the dB?


___________________________________________________________________________________

Neil
NeilG
Posted: Wednesday, July 09, 2008 9:56:45 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
Has no-one any tips?


___________________________________________________________________________________

Neil
jeanres
Posted: Thursday, July 10, 2008 7:42:45 AM

Rank: Newbie

Joined: 7/8/2008
Posts: 7
Location: South Africa
Niel,

I have had the same question. Still have not found a answer. I also have not gotten anywhere with my section I want to create.
NeilG
Posted: Thursday, July 10, 2008 9:59:17 AM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
I followed Per's article originally ... http://objects.dk/2006/9/18/adding-your-own-applications-to-umbraco.aspx

That got me to where I am now.
Noticed that the second "Enquiries" node seems to be related to the "treeTitle" column in the "umbracoAppTree" table. But the row for the "Users" section has a tree title of "Brugere", (Danish for "Users" I think). Some how, this title doesn't appear in the tree in the Users section.


___________________________________________________________________________________

Neil
NeilG
Posted: Thursday, July 10, 2008 4:50:53 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
*********** UPDATE ************

Step closer, the problem is for my new section, the "tree.aspx" page which produces the XML to power the tree is using the "InitTree" method. But when you view users, an additional parameter is passed to the "tree.aspx" call which means its uses a "LoadTree" method.

Whats the difference .. well ..

"InitTree" creates a new node based on the "treeAlias" columns in the dB, then sets a "src" attribute to the results another calll to "tree.aspx", hence the extra node. "LoadTree" doesn't do this, it just instantiates the "ITree" object and calls "Render".

Now the work around ....


___________________________________________________________________________________

Neil
NeilG
Posted: Thursday, July 10, 2008 5:56:03 PM

Rank: Aficionado

Joined: 12/15/2006
Posts: 112
OK, managed to get things how I wanted:



To get this, rather than dowload source-code, rebuild etc, I simply added the following inline method to the "treeinit.aspx" page:

Code:

<script runat="server">

  protected override void OnPreRender(EventArgs e)
  {
    if (!String.IsNullOrEmpty(Request["app"]))
    {
      if (Request["app"] == "enquiries")
      {   
        this.PlaceHolderTree.Controls.Clear();
        this.PlaceHolderTree.Controls.Add(new LiteralControl("<script>\nvar tree = new WebFXLoadTree(\"Enquiries\", \"tree.aspx?rnd=001&contextMenu=&app=enquiries&treeType=enquiries\", \"\", \"javascript:parent.openDashboard('enquiries');\", \"\", \"\", \"\", \"enquiries\", 0, \"C,L\");\ndocument.writeln(tree);\n<"+"/script>"));
      }
    }
  }
 
</script>


Essentially, the Page_Load method in the complied code checks for sections "content", "user" or "media", adding the "treetype" parameter if the section is one of those. If not, the "treetype" parameter is omitted which causes "tree.aspx" to generate an extra node.

My code simply hooks into the OnPreRender, which happens AFTER the compiled Page_Load stuff. Rewriting the call to "tree.aspx" to include the "treeType" param. Obviously this is reeeeaaally specific to my needs, and pretty poor from a maintainability point of view!

A hack but it worked!
Use at your own risk.




___________________________________________________________________________________

Neil
pkoutoul
Posted: Thursday, July 10, 2008 6:23:03 PM

Rank: Fanatic

Joined: 8/9/2007
Posts: 228
Location: Kentucky, USA
Thanks for sharing your struggles and your solution, Neil. I agree that it's a hack, but sometimes that's all you need!

By the way, I really like your idea of putting all of your visitor feedback together on its own tab. Wouldn't it be cool if umbraco included a way (without coding) to add new sections and define content types that would go there. That would be a very useful feature.

Pete Koutoulas • Fayette County Public Schools • Lexington, Kentucky
See you in Chicago at CodeGarden US 2008!
Shandem
Posted: Tuesday, July 29, 2008 7:51:38 AM
Rank: Enthusiast

Joined: 8/13/2007
Posts: 33
Location: Sydney, Australia
Here's a description of a patch that addresses this, but more importantly, all of this functionality is in version 4!

http://forum.umbraco.org/yaf_postsm28045_Fun-with-Trees--New-patch-released.aspx#28045

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.