Skip navigation.

CMS

Custom Login, Logout, My Account And Register Links

You would have seen the navigation menu appearing in the sidebars of many Drupal sites. The navigation menu contains Create Content, My Account and Logout links to the authenticated user. For anonymous users the user login block is set to display in the sidebar on many Drupal sites.

To customize the menu and save space on your sidebars you can take advantage of the flexibility of the Drupal system. I usually disable the navigation menu on almost all Drupal sites I develop. I add custom Login, My Account, Logout and Register buttons and place them in different regions. In the last primer we learned how to add a new region on top of header in a PHPTemplate based theme. I actually created the new region in one of the recent sites I developed to add Login, Register, Logout and My Account links.

Let's start working on the new links.

Adding A New Region In PHPTemplate Based Theme

I recently developed a Drupal site which needed a new region on top of the header. The site required few menus on top of the logo and header. I had to customize the litejazz theme to fulfill this requirement. The site uses litejazz which is a PHPTemplate Drupal theme.

litejazz can be downloaded from: http://drupal.org/project/litejazz

I assume you know how to install a Drupal theme.

Here we go:
Step 1: Defining new region in template.php

  • Go to the litejazz theme directory: ../themes/litejazz
  • Open template.php in a text editor

WYSIWYG Editor And Its Karma

Yesterday, I had to upload a table and a paragraph of text in one of our websites built on Drupal CMS. I prepared the content in OpenOffice.org Writer. I quickly inserted a table and typed the text in a paragraph in OO Writer. I also added some colors to the table to enhance the look and feel of the document. I thought I could easily replicate the design in the Drupal CMS.

I logged in to Drupal and inserted the post with the table and text content. This post defaced the ambiance of the whole web page. The table was displayed in the extreme right and I had to use the horizontal scroll bar in the browser to see the content. The post needed CSS to fix the problem.

I am developing a solution to add a custom CSS file to Drupal from several days. Due to stringent deadlines of the existing projects I'm unable to spend much time on it. The idea of WYSIWYG editor flashed in my mind. I quickly downloaded the TinyMCE software from Moxicode and the TinyMCE module from Drupal. Installed them on the local copy of the Drupal site. The WYSIWYG editor never turned up in the content posting area. I had to spend some more time to fix the installation issue. I did not have enough time to fiddle with WYSIWYG editor installation.

I looked at other alternatives. I exported the OO Writer file to HTML which gave me only 800 lines of XHTML. Inserting 800 lines of XHTML markup was really not worth for a small post.

Finally, I copied and pasted the table from OO Writer to OO Draw. Exported the table as a jpeg image. Uploaded the image and inserted the text in the Drupal site. Added a one liner markup to float the image to the right of the text paragraph. That gave me what I wanted.

Syndicate content