Include custom nav bar on login page

Development-related discussion, including bundled plugins
troyengel
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 23 Mar 2013, 19:39

Include custom nav bar on login page

Postby troyengel » 31 Dec 2013, 20:20

I have my tt-rss in a subdir so wanted to integrate a simple navigation bar to link back to the rest of the site -- do y'all think this is worth submitting for inclusion to the code? I'm no HTML/CSS pro so it's not the slickest looking nav... :) A side effect is that you could use your own custom image or text in place of the official logo - really it's open ended at this point what you could do with the header UI on the Login page.

screenshot - menu floats on the right edge
Image

include/login_form.php - replace the logo div HTML with PHP include and fallback (default):

Code: Select all

<?php
$root_dir = dirname(dirname(__FILE__));
if (file_exists("$root_dir/custom/login_nav.php")) {
        include "$root_dir/custom/login_nav.php";
} else {
?>
<div class='header'>
        <img src="images/logo_wide.png">
</div>
<?php } ?>


custom/login_nav.php - optional! this is the screenshot example:

Code: Select all

<div class='header'>
 <span>
  <img src="images/logo_wide.png">
 </span>
 <span style="color:#222222;float:right;font-size:120%;">
  <ul style="list-style-type:none;margin:0;padding:0;">
   <li style="display:inline;font-weight:bold;">mysite:</li>
   <li style="display:inline;">
    [ <a style="color:#857f33;text-decoration:none" href="/">home</a> ]
   </li>
   <li style="display:inline;">
    [ <a style="color:#857f33;text-decoration:none" href="/thing1">thing1</a> ]
   </li>
   <li style="display:inline;">
    [ <a style="color:#857f33;text-decoration:none" href="/thing2">thing2</a> ]
   </li>
  </ul>
 </span>
</div>


If custom/login_nav.php is missing it'll just fall back to the original div with the logo.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests