This project is read-only.

Creating\editing content in the frontend

Topics: Developer Forum
Jan 26, 2009 at 12:12 PM
Has anyone looked to into creating pages that allow users to do CRUD operations in the frontend, adversed to in the N2 administration. This has proved slightly harder than we intially throught, N2's content items and templates make it very easy to create content in the back end, but in the approch we have taken atleast they are not so helpful in the front end.. In our approch we have essentially wrote our own webforms and simply used N2's content item as our business object and used N2 manually to persist the data.

It kinda feels like we are working around N2 reather than with it. Has anyone done anything more elligant?


Jan 26, 2009 at 7:49 PM
It might be possible to use the itemeditor control. I added an example over here and .cs. Please remember that this control has different goals than exposing editing features to the public. For once it it doesn't validate input (beware of cross site scripting).
Jan 30, 2009 at 12:43 PM
I have been looking at using ItemEditor for the purpose above but I have had problems extending it and EditManager to allow custom behaviour. Would it be possible for you to make the "editors" IDictionary in ItemEditor protected rather than private?
Jan 30, 2009 at 10:02 PM
Can you use AddedEditors or am I missing something?
Feb 2, 2009 at 3:24 PM
AddedEditors only provides a getter. Our current plan is to have an attribute which we can apply to our properties which we can use to filter which fields we want the ItemEditor to display. The problem is that we cannot override CreateChildControls because it uses "editors" and if we use our own IDictionary in the extended class then the CurrentItem method (which is not virtual) will not be able to see it. Therefore we need our custom class to have access to the setter of editors for it to work.
Feb 2, 2009 at 5:38 PM
Okay, I see. Why don't you make the required changes and send me a patch?
Feb 3, 2009 at 2:56 PM
Sure. How would you like me to submit it to you?
Feb 3, 2009 at 9:54 PM
The easiest for me would be an svn patch file. If you use tortoise it's right-click, create patch.
Feb 4, 2009 at 11:45 AM
Ok and where do I upload the patch file to?
Feb 4, 2009 at 9:58 PM
Edited Feb 4, 2009 at 9:58 PM
You can upload it in the issue tracker or send it to me cristian dott libardo at gmail dot com. Thanks.