Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DetonatorB 17 posts 40 karma points
    Jan 04, 2013 @ 02:01
    DetonatorB
    0

    replacing main content tree in umbraco 4.11.1

    Hi,

    I am currently upgrading my site from 4.0.2.1 to 4.11.1.
    Quite a lot of issues, but there is one that I cannot solve without changing the core, so it seems:

    I used to replace the main tree by changing the umbracoAppTree table and set it to my own loadContent provider.

    but in 4.11.1, the main tree is loaded because it has been decorated with the Tree attribute in the core (ApplicationDefinitions.cs and loadContent.cs):

      [Tree("content", "content", "Content", silent: true)]
        public class loadContent : BaseContentTree
        {

    ......

    Because the applications.config and trees.config are rewritten at startup, I cannot intercept this routing.

    How can I replace the main content tree?

    TIA

  • DetonatorB 17 posts 40 karma points
    Jan 04, 2013 @ 10:44
    DetonatorB
    0

    To clarify:

    Umbraco policy for loading trees is (in 4.11.1):

    • Step 1: load the trees by searching all classes that are decorated with the Tree attribute.
    • Step 2: load all the trees that are in the database (umbracoAppTree table) but only for aliases that have not been defined yet in the previous step.

    Therefore, I cannot override any default tree (content, media) because these have been added in step #1.
    I don't like changing the core.
    Is there any other way?

Please Sign in or register to post replies

Write your reply to:

Draft