Add a topBar when a user is logout ?

I want to add a topbar when a user is logout ? So I decided to override the default topbar file.

It seems to be working. I can write a text in a blank topbar and put a css style ! Is it a wrong way ?

<?php
/**
* Elgg topbar
* The standard elgg top toolbar
*/

// Elgg logo
echo elgg_view_menu('topbar', array('sort_by' => 'priority', array('elgg-menu-hz')));

if (elgg_is_logged_in()) {

// elgg tools menu
// need to echo this empty view for backward compatibility.
$content = elgg_view("navigation/topbar_tools");
if ($content) {
elgg_deprecated_notice('navigation/topbar_tools was deprecated. Extend the topbar menus or the page/elements/topbar view directly', 1.8);
echo $content;
}
} else {
echo "Texte TopBar";
}

Thx for helps,

Stephane.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking