ASPX templates
Version 5.x > ASPX templates > Create a document in Blog Structure View modes: 
User avatar
Member
Member
R100 - 6/28/2011 9:28:44 AM
   
Create a document in Blog Structure
I need to be able to structure documents within my News section in blog format. For example, Year -> Month -> Day.

I have been trying to create a Custom Eventhandler to do this. But I am finding some difficulty. I am trying to build a Eventhandler using the following links:

http://devnet.kentico.com/docs/devguide/index.html?event_handling_overview.htm
http://devnet.kentico.com/Forums.aspx?forumid=45&threadid=16143

I am finding it difficult to take things further.

I would be grateful if someone could give me more information on what I need to do in order to achieve a blog structure.

Many thanks for any help.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/30/2011 3:57:23 PM
   
RE:Create a document in Blog Structure
Hello,

Your second link pretty much explains the step which need to be taken. Anyway, are you getting any errors?

What code you've made so far? Please provide us with it. This way we'll be able to tell you more, hopefully.

Have you created that custom event handler correctly?

Moreover, what version of Kentico are you running? Any hotfixes?

Thank you in advance for information.

Best regards
Ondrej Vasil

User avatar
Member
Member
R100 - 7/1/2011 2:45:53 AM
   
RE:Create a document in Blog Structure
Thanks for your reply.

To be honest I am quite lost on how to go forward. I have created a Custom Eventhandler class library with a CustomTreeNodeHandler class (from the Code Samples). I added the code from this link: http://devnet.kentico.com/Forums.aspx?forumid=45&threadid=16143, to my OnAfterInsert event.

I don't know how to tweak it to carry out what I want to achieve. Quite new to Kentico.

I am using Kentico 5.5R2.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/4/2011 6:25:03 AM
   
RE:Create a document in Blog Structure
Hello,

Basically, it won't be just copy-paste job. You'll need to adjust the code Juraj has provided to suit the news scenario - the code shown applies rather to blog-blog month-blog posts situation.

Firstly, you need to create a custom document type - e.g. News Month which will be used the same way as our pre-defined Blog Month document type. In the tree node handler you'll need to work with the objects which are available here (object treeNodeObj, int parentNodeId, object tree) in order to check and create News Month document if necessary and save the News document under it.

Hope this sheds some light.

If you are unable to make it work on your own, you can take advantage of our consulting services: http://www.kentico.com/Support/Consulting-Services.aspx or you can try to contact one of our solution partners in your area to do this task for you: http://www.kentico.com/Partners/Solution-Partners.aspx.

Best regards
Ondrej Vasil