Jump to content

Frontend editor - reload on save


Recommended Posts


Thanks for the awesome front-end editor! Real difference maker when it comes to picking CMS.

However, there is one tiny drawback, which the client has brought up. When I am editing multiple fields in a modal, it would be awesome that on save it would close and also reload the page (so I could actually see the changes).

However, simply reloading location when the form is saved like that

        // click action to save edits
        $('.pw-edit-save').click(function () {
            setTimeout(function () {
            }, 250);

not only leaves the modal open, but also does not update the fields initially.

Any advice?

Link to comment
Share on other sites

For now I've added location reload to

    function modalInitEditableRegions() {

        var regions = $('.pw-edit-modal');
        if (!regions.length)

        $(document).on('pw-modal-closed', function (e, eventData) {
            if (eventData.abort)
                return; // modal.js populates 'abort' if "x" button was clicked
            var target = $(e.target);
            if (!target.is('.pw-edit-modal'))
            var targetID = target.attr('id');
            var viewURL = $('#pw-url').val();
            viewURL += (viewURL.indexOf('?') > -1 ? '&' : '?') + 'pw_edit_fields=' + target.attr('data-fields');

            target.load(viewURL + ' #' + targetID, {}, function () {
                var t = $(this);
                var children = t.children();
                if (children.length) {
                    var html = t.children().html();

but is there a good way to reload on actual save?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...