Global Area only visible when logged in1 user found helpful
<?php $subNav = new GlobalArea('Sub Navigation'); $subNav->display(); ?>
Then, I added an autonav block to the global area.
As long as I'm logged in as administrator, the navigation menu is visible. But when I log out, it's gone.
I didn't set any permissions, it's an almost fresh installation of c18.104.22.168.
This solves my problem: If I delete the autonav block and add it again, it's visible both for administrators and guests.
Can anybody explain this to me?
UPDATE: Ah, now I see what you meant. I used to add blocks to global areas in the frontend (that means directly on the page). Most of the time, this worked. But sometimes, I ran into the problem described above.
Now, I tried to add blocks via Dashboard > Stacks & Blocks > Stacks. Here, I can see the Approve button you probably talked about. If I add blocks here and immediately click the Approve button, everything works like a charm.
I don't know if this is a bug or not. Maybe global areas are not intended for adding blocks in the frontend?
<?php $subNav = new GlobalArea('Sub Navigation'); $subNav->display($c); //you missed your $c variable to display on page ?>
Have a look at the default c5 templates or here:
Though in the developer documentation it clearly state you should supply the page (scroll down to the bottom): http://www.concrete5.org/documentation/developers/pages/areas...
Have you tried it?
Edit: Ah... GlobalArea... You are right, they don't hold $c in the core themes.
Tallacman was right all along. I'm with you on this one as I have missed the approve button a few times myself.
I didn't realize you needed to approve the changes either. :) I only just found that out thanks to you!
I had two global areas on my page: one for the main navigation and one for the sub navigation. In the frontend, I added autonav blocks to both areas immediately after each other and then published the page.
The first block (main navigation) worked fine immediately, but the second block (sub navigation) required to go to Dashboard > Stacks & Blocks > Stacks > Sub Navigation > Approve Changes.
You shouldn't add blocks to several global areas at once.