Showing different headerpane layout just for webportal forms

3
I'm wondering if it's possible to use a different header-pane layout for only 2 forms. The rest of the application should not be affected by this layout change. Tried to solve this with CSS but when i change the header-pane (different logo, color etc.) the new layout is visible through the entire application. Hopefully there's a solution.. Thanks in advance.
asked
1 answers
8

You can achieve this by adding JavaScript to you html, Add the following script

<script type="text/javascript">
    (function() {
        var classes = [];

        dojo.connect(mx.ui, "startup", function() {
            dojo.addOnLoad(function() {
                var roles = mx.session.getUserRoles("Name");

                for (var i = 0, role; role = roles[i++];) {
                    var claz = "role-" + role.toLowerCase();
                    dojo.addClass(document.body, claz);
                    classes.push(claz);
                }
            });
        });

        dojo.connect(mx, "logout", function() {
            for (var i = 0, claz; claz = classes.pop();) {
                dojo.removeClass(document.body, claz);
            }
        });
    })();
</script>

below

<script type="text/javascript" src="mxclientsystem/mendix/mendix.js"></script>

in your html.

This JavaScript is to change the logo by userRole.

Change the logoPane

.role-administrator .MxClient_logoPane
{
    background-image: url(your image);
}

in your layout.css and change the background image for your different userRoles.

answered