Block not displaying
Permalink 1 user found helpful<code>
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<div id="footer">
<!--<span class="powered-by"><a href="http://www.concrete5.org" title="<?php echo t('concrete5 - open source content management system for PHP and MySQL')?>"><?php echo t('concrete5 - open source CMS')?></a></span>-->
© <?php echo date('Y')?> <a href="<?php echo DIR_REL?>/"><?php echo SITE?></a>.
<?php echo t('All rights reserved.')?>
<span width="400" align="center" style="padding-left:210px;"><?php
$bt_main =BlockType::getByHandle('autonav');
$bt_main->controller->displayPages = 'top';
$bt_main->controller->orderBy ='display_asc';
$bt_main->controller->displaySubPages ='none';
$bt_main->render('templates/breadcrumb');
?></span>
<?php
$u = new User();
if ($u->isRegistered()) { ?>
<?php
if (Config::get("ENABLE_USER_PROFILES")) {
$userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>';
} else {
$userName = $u->getUserName();
}
?>
<span class="sign-in"><?php echo t('Currently logged in as <b>%s</b>.', $userName)?> <a href="<?php echo $this->url('/login', 'logout')?>"><?php echo t('Sign Out')?></a></span>
<?php } else { ?>
<span class="sign-in"><a href="<?php echo $this->url('/login')?>"><?php echo t('Sign In to Edit this Site')?></a></span>
<?php } ?>
</div>
</div>
<?php Loader::element('footer_required'); ?>
</code>
rent page in the sitemap -- so if you're on the home page, for example, noth=
ing will show up.
Try changing this line:
$bt_main->render('templates/breadcrumb');
To this:
$bt_main->render('view');
(It's possible there is some other problem as well, but this is the first th=
ing I would try).
-Jordan
>=20
Like I said. Silly question ;)
I logged in as the admin and added an autonav block to the page normally (so not hard-coding it) just to see if it worked, and it did with no problems. The code you posted for that hardcoded autonav block doesn't appear to be hiding it at all so I have no idea why it's doing that... but maybe there's something elsewhere in that page type template that is effecting it (which is why you should post it here).
Weird...
-Jordan
$block->getByName('navigation');
if($block && $block->bID>0)$block->display();
I have added an auto nav to the scrapboook which is where it should grab it from.
This may sound silly but do you have the content within the lagged in area of your footer.php in the elements folder?
ie. not signed in = "Sign in to Edit"
signed in = "Logged in as Username"
maybe near the <span class="sign-in">
I cant load up my dreamweaver at the moment to check how I do it on my site?
Also I would suggest removing your admin account/password from here if you are going to post an account maybe make it a timed account, rather then your super admin account. Its a potential security threat for your site as this is the interwebs and accessible to all.
I know in your post you posted code looks right but what about in your home page type where you call in the footer?
All seems very weird indead
Regards
$block = Block::getByName('navigation');
if( $block && $block->bID ) $block->display();
Can you also get other content to display?? before the signed in section?
Ie
<?php echo t('Test Content.')?>
If this comes up again, try clearing the C5 cache in Dashboard -> Sitewide Settings.
Glad it's finally working for you, though.
Its possible that your were in preview before and when you readded your code you flipped to published.
I bring this up because I've actually done this myself before, and your description sounded just like my previous situations....
Another possibility is that the pages that the autonav block is trying to show are not published or don't have permissions to be shown to non-logged-in users (so the autonav block is actually there on the page but it has nothing to display).
BTW, your link doesn't work.