Copied to clipboard

Flag this post as spam?

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


  • Jason Evans 50 posts 71 karma points
    Feb 12, 2013 @ 17:50
    Jason Evans
    0

    How to programmatically change content tree area.

    Is there a way that I can change, via the API, the area that the content tree on the left of an Umbraco page is set to? For example, I'd like to programmatically say

    changeTreeToPointTo('media');

    I notice that the Area links that appear at the bottom, in the Sections portion, use a method named "appClick()" which is defined in Umbraco.aspx. I've tried calling that method myself, but I get an "undefined" error since "appClick" does not exist for my code.

    Can someone suggest a way for me to achieve this functionality?

  • Jason Evans 50 posts 71 karma points
    Feb 13, 2013 @ 12:08
    Jason Evans
    0

    I found a way to do this.

    I have the following JavaScript defined in my ASPX file:

       <script type="text/javascript">
            function changeTreeView() {
                window.parent.appClick.call(this, 'content');
            }
        </script>

    Since the ASPX will be displayed in the content area, on the right side, it will be inside an IFRAME. So in order to "see" applClick() method I need to reference the !window.parent" object. Doing this allows me access to appClick() and calling it does indeed change the treeview to the "Content" view.

Please Sign in or register to post replies

Write your reply to:

Draft