Somewhat weird situation, but it is what it is.

Decreed that user accounts are no longer required for access to spec documents. That's good.

However, we have various editors who will still edit content and will need to log in. The simple thing is to just give them a url to bookmark with the ?q=user added. Works fine.

However, I need to add a logout link so they can actually sign out. So, I need to somehow tell Drupal, based on role authentication, show this link.

I tried putting the default User Login block in the header and checked the domains and roles of the various editors and authenticated web user but they aren't showing. Could this be due to login/logout links of the Primary menu being disabled?

Next, I tried making a block with simple text: logout with the link of logout but it's not showing up in the header either. And yes, I tried other pages using the basic page.tpl.php template to make sure the block was in a used region.

I'm not afraid to slam some php somewhere, but I'd like to think I'm just missing something.

1 Answer 1


You can add a standard menu item to any menu with a path of user/logout.

  • 2
    Nearly positive that menu router entry has an access check on it already, so you don't have to add your own check.
    – mpdonadio
    May 24, 2013 at 0:16
  • @MPD Good point, I updated the answer. May 24, 2013 at 0:19
  • I made a block. Entered basic html like: <a href="user/logout">Logout</a> selected the appropriate domains, restricted to roles of authenticated user, various editing roles and selected to "show on all pages except" and didn't add any pages. I Put that block in the Header region, saved and logged in as a basic editor (one with the same role assigned above) but the block doesn't show. The logic seems pretty straightforward but the Domain Access module has caused other issues...I'm wondering since I'm at an IP right now and not really a 'www.something.com' if that's an issue? May 24, 2013 at 16:27
  • What a newbie. Cleared all the caches and it works. Well, six months into my Drupal learning curve and I'm still forgetting the basics! May 24, 2013 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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