I am implementing custom section and tree in umbraco
I have AppPlugins folder structure
AppPlugins/[Sectionname]/backoffice/CustomTreeName/(create/edit html file)
i have a logic to open a new.html file in create.html(this is the right click menu option) file like :
<a href="new.html">
however its not getting redirecting to it.The new.html file is in the same directry ,under CustomTreeName.
Can you please help where i can place the new.html file so that it can be redirected by create.html file and also the controller file of it?
have you exactly this a-tag in your view?
Because if yes you have to add the complete path in the href Attribute like: #/section/treeName/action?params=
Can you please help?
There is an issue with the package.manifest file
I have a custom section and tree structure
App_Pluggins/[SectionName]/backoffice/[Treename]
If i am placing the package.manifest file at [TreeName] level umbraco is getting started but the js file linked in manifest file its not loading up.However if i am placing package.manifest file[SectionName],umbraco showing blank page with the below error message.
Can you do me favor pls ,I am stuck in getting tree node Id.
How we can get the current tree node Id in angular js and pass it to the controller?
any idea?
the error message is because your method in your api controller doesn't allow HttpPost. To enable this you have to add the [HttpPost] attribute to the method. Beware that there are two attributes with the same name, one for MVC and one for Http. You need the last one.
For the id of the tree node i'm currently somewhat out of ideas.
In my use cases until now i just saved the items to the database because i know on which node i want to show them and there aren't multiple locations.
My first idea was to look at the TreeService but it seems that he hasn't a method to get the current active node. The only thing that remains is to provide the id through all url calls. So add it to the menu item url and then to the edit url as second parameter.
custom tree routing
I am implementing custom section and tree in umbraco I have AppPlugins folder structure AppPlugins/[Sectionname]/backoffice/CustomTreeName/(create/edit html file)
i have a logic to open a new.html file in create.html(this is the right click menu option) file like :
however its not getting redirecting to it.The new.html file is in the same directry ,under CustomTreeName.
Can you please help where i can place the new.html file so that it can be redirected by create.html file and also the controller file of it?
Thanks Harshit
Hi Harshit,
have you exactly this a-tag in your view? Because if yes you have to add the complete path in the href Attribute like: #/section/treeName/action?params=
Hope that helps.
Regards David
Hi David, Thanks for the reply.
yes I am using a- tag
and now i am getting this error
what will be the params in the routing? can you please help?
Regards, Harshit
Hi Harshit,
i looked again at some source i have and the query parameters are Lister with a / between them.
So i think it should be ".../edit/true" in your example. Can you try that.
If that doesn't work then can you provide the tree- Attribute and section alias you used. Maybe its just a spelling issue.
Regards David
thanks a lot. it worked
this is the path i have given in the hyperlink
i have small doubt, i have a controller file for this new.html where i can place it ,i mean in the same directory or in different place?
Regards, Harshit
You can place it wäre you want. So maybe for better structuring keep them seperated.
Only thing you need is to add the file in your package.manifest file
Thanks a lot David :)
Hi David,
Can you please help? There is an issue with the package.manifest file I have a custom section and tree structure App_Pluggins/[SectionName]/backoffice/[Treename] If i am placing the package.manifest file at [TreeName] level umbraco is getting started but the js file linked in manifest file its not loading up.However if i am placing package.manifest file[SectionName],umbraco showing blank page with the below error message.
Hi Harshit,
the file must be placed in the [sectionName] folder. Seems like there is an error in the manifest file. Can you post it so i can check?
Regards David
Hi David,
I have defined a view where it calling a controller path : App_pluggins/[SectionName]/backoffice/[TreeName]/createView
and this controller is in CreateCtrl.js file
this js file path is in the manifest file.
now the above error message are not coming ,umbraco is loading up however is not calling the js file linked in manifest.
Can you please help on this?
Regards, Harshit
Hi David ,
Thanks, i have found the solution :)
Hi Harshit,
sorry for the late response. Glad you found it.
Regards David
Hi David,
Can you do me favor pls ,I am stuck in getting tree node Id. How we can get the current tree node Id in angular js and pass it to the controller? any idea?
Regards, Harshit
Hi Harshit,
where do you need the ID. In the angular view or when you build your tree?
Normally you would provide the ID of the current node as a Route param.
Regards David
Hi David,
I want it in the API through controller,so that i can add content to the parent id . i have uploaded the cod in the below link. https://gist.github.com/SinghHars/b5bbca636d85eb610a7d
currently i am passing hard coded value as parent: 1046.
$http({ method: 'POST', url: '/umbraco/api/StatusApi/PostStatus/', params: { parent: 1046 }, data: $scope.status })
if i am doing so, i am getting “Failed to load resource: the server responded with a status of 500 (Internal Server Error)”:
http://umbracoCustomSectionTest.com/umbraco/api/StatusApi/PostStatus/?parentId=1046
this is the error message if i am clicking on the link:
The requested resource does not support http method ‘GET’.
===================================================
please help.
Thanks, Harshit
Hi Harshit,
the error message is because your method in your api controller doesn't allow HttpPost. To enable this you have to add the [HttpPost] attribute to the method. Beware that there are two attributes with the same name, one for MVC and one for Http. You need the last one.
For the id of the tree node i'm currently somewhat out of ideas. In my use cases until now i just saved the items to the database because i know on which node i want to show them and there aren't multiple locations.
My first idea was to look at the TreeService but it seems that he hasn't a method to get the current active node. The only thing that remains is to provide the id through all url calls. So add it to the menu item url and then to the edit url as second parameter.
Regards David
Thanks David,
still the same error 500 :( Can you share how to save content in database and then linked to the specific node if possible?
Harshit
is working on a reply...