How to add log in to the bottom of page in my theme?

Permalink
I searched for about 45 minutes but I couldn't find this topic. I changed my theme in the dashboard to my site's custom theme and of course it would appear that if I do that I am locking myself out of the dashboard. I need to get the code into my theme to bring up the login.

I tried throwing the elements/footer.php and php code into my default.php but that didn't seem to have an effect. I then tried to just add the footer div from the footer.php and that didn't seem to make a change either.

Oh well, what do I do?

Thanks very much!

neptune
 
Remo replied on at Permalink Reply
Remo
use this code
<span class="sign-in"><a href="<?=$this->url('/login')?>"><?=t('Sign In to Edit this Site')?></a></span>
neptune replied on at Permalink Reply
neptune
Thanks very much Remo. I don't follow you though. I added that code to my default.php and on its own it doesn't appear to have an effect. Could you flesh that out a bit more?
kutis replied on at Permalink Reply
kutis
if u don't have a common footer file, the place it to all page types
neptune replied on at Permalink Reply
neptune
I think a common footer is the way to go. I created one but I am such a n00b that it is appearing at the top of the page instead of the bottom. I don't really know why.www.www.stainedonline.com/index.php... if you'd care to take a look.
AnotherAndrew replied on at Permalink Reply
AnotherAndrew
on you page, default.php, change this:

<div id="footer">
         <span class="powered-by">Built with  <a href="http://www.concrete5.org">concrete5 CMS</a>.</span>
                  &copy; 2009 <a href="/">Stained Glass Online</a>.
         &nbsp;&nbsp;
         All rights reserved.   
         <span class="sign-in"><a href="/index.php/login">Sign In to Edit this Site</a></span>
</body>
</html></div>


TO:

<div id="footer">
         <span class="powered-by">Built with  <a href="http://www.concrete5.org">concrete5 CMS</a>.</span>
                  &copy; 2009 <a href="/">Stained Glass Online</a>.
         &nbsp;&nbsp;
         All rights reserved.   
         <span class="sign-in"><a href="/index.php/login">Sign In to Edit this Site</a></span>
</div>
</body>
</html>
chaosdivine replied on at Permalink Reply
chaosdivine
Hi Neptune, Remo is giving you the right answer to your problem but he is using short PHP tags
<?= ?>
which is short for PHP's echo statement and this may hinder you if you don't have short tags enabled in your PHP.INI file.

It also looks like AnotherAndrew above was trying to give you the exact code to use but forgot to include PHP tags in his code blocks.

So I would try using the full PHP tags and echo statement first to see if that helps you out.

Remo's code with LONG style PHP tags and echo statement:
<span class="sign-in"><a href="<?php echo $this->url('/login')?>"><?php echo t('Sign In to Edit this Site')?></a></span>


Notice that I changed <?= to <?php echo

Anyhow, not all server environments let you enable short tags. So I would error on the side of caution and use long tags when possible. If your have access to your PHP.INI file then open it up and search for the following to enable short tags (then Remo's code will work as posted): short_open_tag = Off and change it to short_open_tag = On

You will have to restart your PHP/Apache server for this to work.

Hope this helps you out.

--
Drew (a Third Andrew)