Block shows in edit but not in non-edit.

Permalink
I am trying to change a global block from embedded in a header to manually adding it to a global area in the header.

Old Code:
<?php $bt_autonav->render('templates/header_nav/view'); ?>

New Code:
<?php
$autonav = new GlobalArea('Autonav');
$autonav->setBlockLimit(1);
$autonav->setCustomTemplate('global_autonav', 'templates/header_nav/view');
$autonav->display($currentPage);
?>

New Code works perfectly in edit mode but does not show in non-edit mode. Old code works both places. I have cleared all Concrete5 and browser caches and I get the same. I also have similar global area code in the same header that works perfectly.

Global area code that works in same header:
<?php
$a = new GlobalArea('Logo');
$a->setBlockLimit(1);
$a->setCustomTemplate('global_image', 'templates/header_logo_image/view');
$a->display($currentPage);
?>

What am I missing ?

Thanks,

Warren Bell

warish
 
warish replied on at Permalink Reply
warish
I mis spoke on when it does not show. The global block does not show when I log out of the Concrete5 backend.
Gondwana replied on at Permalink Reply
Gondwana
If something shows only when logged in, that often indicates that a required javascript file (typically jquery) isn't being loaded. The c5 editing UI loads a bunch of stuff for its own use, but only when logged in. Research about requiring assets so c5 knows what you need.
c5dragon replied on at Permalink Best Answer Reply
c5dragon
Another possibility:
Select the global area here and approve the changes.
.../index.php/dashboard/blocks/stacks/view_global_areas
warish replied on at Permalink Reply
warish
Thank you c5dragon, that worked. I was not aware of the approval process.