문제

When I am in the N2 management / admin interface, if I click on a node in the tree, by default it shows the output of that page. I can show the edit screen for that node by right clicking the node and clicking 'Edit'. Can I get it to show the edit screen for that node by just clicking the node? Is there some setting I can change in web.config?

도움이 되었습니까?

해결책

So the comment that I left on the question above doesn't really answer the question (it works only for the root node). However, pretty much everything in N2 is pluggable, so you can use the dependency injection framework to replace the code that generates URLs in the edit interface with your own code as follows:

using N2.Configuration;
using N2.Edit;
using N2.Engine;
using N2.Web;

namespace MyWebsite
{
    [Service(typeof(IEditUrlManager), Replaces = typeof(EditUrlManager))]
    public class MyEditUrlManager : EditUrlManager
    {
        public MyEditUrlManager(IUrlParser parser, EditSection config)
            : base(parser, config)
        {

        }

        public override string GetPreviewUrl(N2.ContentItem selectedItem)
        {
            return GetEditExistingItemUrl(selectedItem);
        }
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top