RE-POST: Forums seem to be playing up and I require urgent help with this problem please.
I have created a contact form as a user control which inserts data into a database. The database content then needs to be loaded into a custom section of Umbraco V4.
Below is the start of my c# code.
[code]namespace FinancialServices.Umbraco.Extensibility
{
public class FormContactTreeLoader : ITree
{[/code]
The table in the database dbo.umbracoAppTree has two important fields treeHandlerAssembly and treeHandlerType. Below are the values I have in the table.
[code]namespace FinancialServices.Umbraco.Extensibility
{
public class FormContactTreeLoader : BaseTree
{
public FormContactTreeLoader (string application) : base(application) { }
public override void RenderJS(ref System.Text.StringBuilder Javascript)
{
Javascript.Append(@"
function openContact(id) {
parent.right.document.location.href = 'plugins/Contact/ContactManageMent.aspx?id=' + id;}");
}
public override void Render(ref XmlTree tree)
{
//Generate your tree
}
}
}[/code][/quote]
Ronnie, this is great!! What a huge help this has been. Thanks a ton! For those looking for a solution to this, see the Word document on the page from Ronnie's link above.
Custom Section Umbraco v4
RE-POST: Forums seem to be playing up and I require urgent help with this problem please.
I have created a contact form as a user control which inserts data into a database. The database content then needs to be loaded into a custom section of Umbraco V4.
Below is the start of my c# code.
[code]namespace FinancialServices.Umbraco.Extensibility
{
public class FormContactTreeLoader : ITree
{[/code]
The table in the database dbo.umbracoAppTree has two important fields treeHandlerAssembly and treeHandlerType. Below are the values I have in the table.
[code]treeHandlerAssembly = FinancialServices.Umbraco.Extensibility
treeHandlerType = FormContactTreeLoader[/code]
The code inside the class is identical to that which is available here.
When I go to my custom section the tree node Data is visible and then the first child node displays the following.
[code]- data
|--- Click to edit this item Error[/code]
I think you might have to compile this into an assembly called FinancialServices.Umbraco.Extensibility.dll
try that and see if it works.
I have the same exact problem. Any insight would be welcomed. Thanks.
-- Nik
In umbraco 4 you need to inherit from BaseTree instead of ITree
http://suite101.thefarmdigital.com.au/post/2008/11/Umbraco-Version-4--Tree-API.aspx
so the code could look something like this
[code]namespace FinancialServices.Umbraco.Extensibility
{
public class FormContactTreeLoader : BaseTree
{
public FormContactTreeLoader (string application) : base(application) { }
public override void RenderJS(ref System.Text.StringBuilder Javascript)
{
Javascript.Append(@"
function openContact(id) {
parent.right.document.location.href = 'plugins/Contact/ContactManageMent.aspx?id=' + id;}");
}
public override void Render(ref XmlTree tree)
{
//Generate your tree
}
}
}[/code]
[quote=Ronnie]In umbraco 4 you need to inherit from BaseTree instead of ITree
http://suite101.thefarmdigital.com.au/post/2008/11/Umbraco-Version-4--Tree-API.aspx
so the code could look something like this
[code]namespace FinancialServices.Umbraco.Extensibility
{
public class FormContactTreeLoader : BaseTree
{
public FormContactTreeLoader (string application) : base(application) { }
public override void RenderJS(ref System.Text.StringBuilder Javascript)
{
Javascript.Append(@"
function openContact(id) {
parent.right.document.location.href = 'plugins/Contact/ContactManageMent.aspx?id=' + id;}");
}
public override void Render(ref XmlTree tree)
{
//Generate your tree
}
}
}[/code][/quote]
Ronnie, this is great!! What a huge help this has been. Thanks a ton! For those looking for a solution to this, see the Word document on the page from Ronnie's link above.
-- Nik
This tree you can create your self, where will that be displayed in umbraco? Under the setting page or content, or can you even configure that?
Hi,
It's configurable through database tables umbracoAppTree.
Regards,
/Dirk
In case anyone else is looking for this, the link has changed and seems to be located at:
http://suite101.thefarmdigital.com.au/2008/11/25/default.aspx
is working on a reply...