Tuesday, March 9, 2010

How can I hide the Logout link that appears as part of EKP's navigation controls?

By default EKP displays a Logout link as part of its navigation controls. In some cases it might be desirable to hide this link, in particular if EKP is being used in conjunction with a single sign-on solution in which it is not desired to provide application-specific sign-out functions.

This post describes a simple way to hide the Logout link using a Cascading Style Sheets (CSS) rule. Because it is CSS-based, this technique can be applied to specific skins, such that the Logout link appears only for specific groups of users depending on their skin setting.

The technique relies on the fact that, in most skins, the Logout link is the only element with both a class='sec-links' attribute and a target='_top' attribute. Therefore, applying the CSS rule shown below has the effect of hiding the Logout link without affecting other navigation links.

.sec-links[target="_top"] {display: none;}

For skins in which the Logout link appears in the left frame (or the right frame for right-to-left skins), this rule should be added to the file named left.css inside the skin directory. For example, for the EKP-60 skin the rule would be added to the file named left.css inside the nd/fresco/styles/EKP-60/ directory. For skins in which the Logout link appears in the top frame, this rule should be added to the file named top.css inside the skin directory.

This technique should work for most recent skins. It might not work for certain older skins, in particular those that use images for button labels.

2 comments:

Bastiaan Timmer said...

Hi Robert,

Great blog! You can also hide the other menu options, if you use the title tag instead of the target.

So if you use the css class below, then you can hide the HELP option:

.sec-links[title="Help"] {display: none;}

Thanks!

Bastiaan

Robert Lowe said...

Bastiaan, the thing to be careful about there is that the value of the title tag depends on the language setting. So you could have a surprising side-effect where the link appears or disappears if the user changes his or her language preference.

But if you're only using one language—or a small number of languages—then that will certainly work.