0

Zenbu offers the option to add a Live Look link to it's entries overview. But our client was complaining, this doesn't work for draft entries (using Publisher). Adding the {exp:publisher:toolbar} to the template is also not an option for them.

To be able to view the entry as draft, you need to add ?publisher_status=draft to the preview template url. But there's no way to do that

0

Option 1: Add javascript to preview template

Add this script to the preview template you want to use for previewing Prublisher draft entries:

<script>
    var url = window.location.href;
    if (url.indexOf('publisher_status') == -1){
        if (url.indexOf('?') > -1){
            url += '&publisher_status=draft'
        }else{
            url += '?publisher_status=draft'
        }
        window.location.href = url;
    }
</script>

Only when no publisher status is present in the querystring, it will be added and the page will be refreshed.

Option 2: Change the Fancybox code in Zenbu

Look for the zenbu_index.js file in /third_party/zenbu/javascript and look for Fancybox for Live Look.

Replace this

$(this).fancybox({
    'overlayShow'       : true,
    'centerOnScroll'    : true,
    'type'              : 'iframe',
    'width'             : '90%',
    'height'            : '90%',
    'autoScale'         : true,
    'titlePosition'     : 'inside'
});

With this

var FancyBoxHref = $(this).attr("href")+"?publisher_status=draft";

$(this).fancybox({
    'href'              : FancyBoxHref,
    'overlayShow'       : true,
    'centerOnScroll'    : true,
    'type'              : 'iframe',
    'width'             : '90%',
    'height'            : '90%',
    'autoScale'         : true,
    'titlePosition'     : 'inside'
});

This involves editing code from the Zenbu module. So keep in mind that updating the module will also undo those changes. And it will add the querystring to all live look url.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.