I would like to add a Facebook style or StackExchange style top navbar to my site. It should show the username, mini profile pix, userpoints, search box and a few other links.

Is there a module for that?


I don't find any module does that specific purpose of making top bar. It is usually done by custom themeing. Basically, you add a new region to your theme. For example, You define a new region called "topnav" in .info; code the markup in template.php and .css files. Then go to block administration page, assign stuffs to the topnav region.


I have also wanted to do this, I have edited the "mix and match" theme but this should work on any theme in theory.

edit the page.tpl.php

add the following code at top of page

<style type="text/css">
#userbar {text-align:right; margin-right:auto; margin-left:auto;}
<?php global $user;
$uid = $user->uid;
$points = userpoints_get_current_points($uid);

this makes your links right aligned and declares $points for the user logged in.

to add the content you also add the following (position this on the page where you want your bar to appear, ie in the header).

<?php if ($user->uid): ?>
<div id="userbar"><a href="user"><?php print $user->name; ?></a> Points: <?php print $points; ?></div>
<?php endif; ?>

you can also add other things to your bar as required :)


There is a great Nav Bar module called Mobile Friendly Navigation Toolbar:

A very simple mobile friendly navigation toolbar introduced as part of the Spark project to solve mobile editing problems with the Drupal 7 shipped toolbar, that is not very friendly to small screen sizes.

This module is only for Drupal 7, though.

Not the answer you're looking for? Browse other questions tagged or ask your own question.