Copied to clipboard

Flag this post as spam?

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


  • Nijaz Hameed 19 posts 123 karma points
    Apr 24, 2019 @ 13:37
    Nijaz Hameed
    0

    Show a popup / dialogue box after successful login to Umbraco

    I want to show certain instructions to the admin user after they login to Umbraco.

    I have followed the article https://24days.in/umbraco-cms/2015/umbraco-7-back-office-tweaks/ to add a Javascript file that can show a js alert post login.

    angular.module('umbraco').config(['$httpProvider',function ($httpProvider) {
    
        $httpProvider.interceptors.push(function ($q) {
            return {'response': function (response) {
    
                if (response.config.url.indexOf("/umbraco/backoffice/UmbracoApi/Authentication/PostLogin") !== -1) {
                        alert('TEST')
                        // dialogService.open({template: '/app_plugins/SuccessLoginPopup/successlogin.htm',show: true});                          
                        //$("<div>This is a test</div>").dialog();
                    }
                    return response;
                }
            };
        });
    }
    

    ]);

    The alert works fine on the above code but the dialogService is not available and shows error.

    Is there any solution I can display a nice html popup with instructions to admin post login?

    There is Umbraco tours - but thats not usable for me as I want to write some login to the JS code to display various information based on the dates.

    Any help would be greatly appreciated

  • Rhys Hamilton 140 posts 940 karma points
    Apr 24, 2019 @ 13:46
    Rhys Hamilton
    1

    In order to use the dialogService, you'll need to inject it as a dependency in the same way you've included the $httpProvider.

    For example, something like the following should work:

    angular.module('umbraco').config(['$httpProvider', 'dialogService', function ($httpProvider, dialogService) {
    
Please Sign in or register to post replies

Write your reply to:

Draft