Copied to clipboard

Flag this post as spam?

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


  • Bilal Haidar 144 posts 410 karma points
    Sep 19, 2016 @ 13:29
    Bilal Haidar
    0

    Angularjs Directives available for backoffice

    Hi,

    Where can I find samples/documentation on using the different angularjs directives that could be used in the backoffice when developing custom trees.

    For instance:

    umb-panel umb-panel-header etc.
    

    Thanks

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 19, 2016 @ 13:31
    Michaël Vanbrabandt
    0

    Hi bilal,

    you can find all of this infomation here:

    https://our.umbraco.org/apidocs/ui/#/api

    /Michaël

  • Bilal Haidar 144 posts 410 karma points
    Sep 19, 2016 @ 13:45
    Bilal Haidar
    0

    Thanks Michael. I already checked this link before. It lacks explanation / examples on how to use the different directives, how to wrap them within each other, etc.

    For instance for a single View, it starts with a umb-pane then inside it a header, etc.

    Appreciate if you can point me there.

    Thanks

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 19, 2016 @ 13:52
    Michaël Vanbrabandt
    100

    Bilal,

    I know but it gives you a starting point.

    What I mostly do is checking other umbraco pages by looking into the source code to see when or where they use directives.

    All directives and views that umbraco has builtin you can find in the folder: Umbraco/Views/.

    Hope this helps.

    /Michaël

  • Bilal Haidar 144 posts 410 karma points
    Sep 19, 2016 @ 13:53
    Bilal Haidar
    0

    Thanks Michael for your help. For now I guess this is the best thing to go over what has been done in the framework.

    /Bilal

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 19, 2016 @ 13:58
    Michaël Vanbrabandt
    2

    Bilal,

    maybe this can be helpfull to:

    New template for the backoffice could look like this:

    <form ng-controller="" val-form-manager>
        <umb-panel>
    
            <umb-header tabs="visibleTabs">
                <div class="span7">
                    <div class="umb-headline-editor-wrapper">
                        <h1>Titel</h1>
                    </div>
                </div>
                <div class="span5"></div>
            </umb-header>
    
            <umb-tab-view>
                <umb-tab id="tab1">
    
                    <div class="umb-pane"">
    
    
                    </div>
    
                </umb-tab>
            </umb-tab-view>
    
        </umb-panel>
    
    </form>
    

    To add an overlay:

        <!-- Overlay -->
        <umb-overlay ng-if="overlay.show"
                     model="overlay"
                     view="overlay.view"
                     position="right">
        </umb-overlay>
    

    /Michaël

  • Bilal Haidar 144 posts 410 karma points
    Sep 20, 2016 @ 18:45
    Bilal Haidar
    0

    Hi Michael,

    Following up on the above, in the

    Umbraco-CMS/src/Umbraco.Web.UI.Client/src/views/media/edit.html
    

    There is this markup:

     <umb-editor-header
            name="content.name"
            tabs="content.tabs"
            menu="page.menu"
            hide-icon="true"
            hide-description="true"
            hide-alias="true">
         </umb-editor-header>
    

    The above directive sets up the header part of the edit view.

    Now in the controller, Umbraco retrieves the Media Item as a Node, hence "page.menu", currentSection, currentNode, etc, are all populated.

    In case I want to use the same directive, in my case, when I click on a custom section tree node, I am retrieving a record from database. Hence, the page.menu and rest of properties needed by the above built-in directive won't be available! Hence, won't be able to use it.

    However, if I store my data as normal content items, maybe the above could work.

    What's the recommendation here?

    Shall I see how the built-in directive renders, and use the rendered html instead and provide whatever data i can?

    Thanks

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 21, 2016 @ 06:38
    Michaël Vanbrabandt
    0

    Hi Bilal,

    you are correct, if you want to use this directive you need to populate these fields by yourself in your controller.

    So you need to set the content.name, content.tabs and page.menu fields.

    /Michaël

  • Bilal Haidar 144 posts 410 karma points
    Sep 21, 2016 @ 08:07
    Bilal Haidar
    0

    Thanks.

    Is there a way in Umbraco that I can use to wrap my "data nodes" as an umbraco node (including path, tabs, etc.)?

    /Bilal

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 21, 2016 @ 08:22
    Michaël Vanbrabandt
    0

    Bilal,

    maybe you can create your own model with all of these properties to push to your controller?

    /Michaël

  • Bilal Haidar 144 posts 410 karma points
    Sep 21, 2016 @ 13:20
    Bilal Haidar
    0

    Some of them are difficult to recreate. Anyways, I will see how to manage and share any feedback if I reach somewhere.

    Thanks /Bilal

Please Sign in or register to post replies

Write your reply to:

Draft