I'm not sure if i'm posting this in the right section.
I need to have a form on the front end of the site that will write to a node in the admin area.
It's basically a note about an account. The heirarchy is as follows:
Accountant >> Company >>>>Client >>>>Client >>>>>>>>Note >>>>>>>>Note >>>>>>>>Note
I need to have the client, from a form on their profile page on the front end, to be able to write a note against themselves and have it publish under the Client node as per the heirarchy above.
I'm guessing I need a document type firstly with the author name, date and note (as textarea) but what would I need in the usercontrol to allow the form to write a note to the client node?
Its a basic text field and textarea that needs to write a note under a parent node. The parent node of the current page the user is logged into (their account effectively)
The usercontrol would need to pick up the nodeID from the currentPage.
Once submitted, it would write content to the node using the 'notes' document type, publish it and send an email to the admin to alert them that a new note has been added.
Before I go ahead with subscribing, is this simple enough to do?
I subscribed to the videos but the control for adding content programmatically doesnt work with the latest version of umbraco. It gives build errors and falls over when trying to run the page withthe macro. I feel like i've just wasted 23 euros :(
Hi Roger, can you post any pictures of the errors you are getting?
If you are using the latest version of Umbraco the code below should work, you will just need to query to get the parentNodeId.
Hopefully this helps. I have been watch a few of the videos and I still think they are relevant as they explain a lot of core concepts. They may be a little out of date as Umbraco development is moving quickly. UMbraco HQ are working on the Beta for UMbraco TV and I think you will find a lot of helpful tutorials on there as well (your login should let you vie wthe videos), you can find it at http://beta.umbraco.tv/.
If you need any more help or advice please just ask.
//get the content service from this.UmbracoContext.Application.Services var contentService = UmbracoContext.Application.Services.ContentService; //Create content, pass in the parent id and the document type alias. var contentNode = contentService.CreateContent("Name of your node", parentNodeId, "documentTypeAlias"); //Set the propeties on the contentNode contentNode.SetValue("youPropertyAlias1", "value1"); contentNode.SetValue("youPropertyAlias2", "value2"); contentNode.SetValue("youPropertyAlias3", "value3");
//Now we need to save and publish the node contentService.SaveAndPublish(contentNode);
Form to write notes to a node
Hi all,
I'm not sure if i'm posting this in the right section.
I need to have a form on the front end of the site that will write to a node in the admin area.
It's basically a note about an account. The heirarchy is as follows:
Accountant
>> Company
>>>>Client
>>>>Client
>>>>>>>>Note
>>>>>>>>Note
>>>>>>>>Note
I need to have the client, from a form on their profile page on the front end, to be able to write a note against themselves and have it publish under the Client node as per the heirarchy above.
I'm guessing I need a document type firstly with the author name, date and note (as textarea) but what would I need in the usercontrol to allow the form to write a note to the client node?
Can someone please help?
Im wondering, can Contour do this?
Can anyone advise how to do this from a usercontrol???
There is an excellent tutorial at the URL below:
http://umbraco.com/help-and-support/video-tutorials/developing-with-umbraco/working-with-data/creating-data-programmatically/TVPlayer
I would recommend purchasing a subscription for the videos as they will walk you through most of what you need to do in Umbraco.
A good reference is also the documentation on our.umbraco.org, below is a link to the API class that should help you do what you need:
http://our.umbraco.org/documentation/Reference/Management-v6/Services/ContentService
Give this a go and f you are struggling with anything just ask.
Hi Brendan,
Thanks for the help.
Its a basic text field and textarea that needs to write a note under a parent node. The parent node of the current page the user is logged into (their account effectively)
The usercontrol would need to pick up the nodeID from the currentPage.
Once submitted, it would write content to the node using the 'notes' document type, publish it and send an email to the admin to alert them that a new note has been added.
Before I go ahead with subscribing, is this simple enough to do?
Thanks again
Hi Brendan,
I subscribed to the videos but the control for adding content programmatically doesnt work with the latest version of umbraco. It gives build errors and falls over when trying to run the page withthe macro. I feel like i've just wasted 23 euros :(
Any other ideas?
Hi Roger, can you post any pictures of the errors you are getting?
If you are using the latest version of Umbraco the code below should work, you will just need to query to get the parentNodeId.
Hopefully this helps. I have been watch a few of the videos and I still think they are relevant as they explain a lot of core concepts. They may be a little out of date as Umbraco development is moving quickly. UMbraco HQ are working on the Beta for UMbraco TV and I think you will find a lot of helpful tutorials on there as well (your login should let you vie wthe videos), you can find it at http://beta.umbraco.tv/.
If you need any more help or advice please just ask.
Thanks Brendan,
That makes more sense!
I'll give it a try. Again, many thanks for the help
Roger
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.