Hi guys,

i dont know if is the right place to post my problem...

I want to see the username of the current user as primary link.

i testet very much but it doesnt work

' print $user->uid;' etc.

i looked to the html-sourcecode and i saw that some symbols are converted in other "varibles"

for example '<' is '&'lt;' (without ')

Do you know a solution?

thx

Rox

Comments

alex’s picture

I believe you can't normally have php code in title executed. You either put your php in a field with input format PHP code, or directly in your theme template.

Cheers,

alex

Hills Web

alan d.’s picture

I think that you could do this via theme_menu_link. Just add a placeholder token as the menu item, and check for this in the theme override.

Another way is to create a module to do a custom menu link, but that would be overkill unless you already have a module that you could use.


Alan Davison
Mr.Rox’s picture

Thank you very much.

Where I must write it? page.tpl.php?

Can you write an example please?

Thx a lot

Rox

abdullah5588’s picture

Hi Rox,
login to the site http://www.dashplanet.com with username "test" password "test" and check out the top left block. Is it somewhat near to what you require?

This is very customizable, let me know if you need something like that and i'll explain with details.

Abdullah

Mr.Rox’s picture

hi abdullah,

yeah but not a block but a primary link like facebook with 'your name' and when you click you goes to your profile.

abdullah5588’s picture

Please wait just a few moments. Im gonna tell you shortly what you can do as alternative.

Mr.Rox’s picture

thx a lot

i have time no stress ;)

Rox

abdullah5588’s picture

All done. I compiled a little article and posted on the site.
Customizng Drupal Login Block As Horizontal Bar and Adding Links

Also try http://drupal.org/node/17272 for more.

Mr.Rox’s picture

thank you very much.

there is only one error:

original:

print "<ul id="mylinkbar">";

corect:

print "<ul id='mylinkbar'>";
abdullah5588’s picture

Ooops. :D Thanks a lot for correction.

Mr.Rox’s picture

It's possible to highlight this primary link in my block where i am?

example: When I am on the Homepage of the site, i want to see my primary link "Home" in an other color or something like this?

Thank you

Rox

abdullah5588’s picture

Hi Rox, this can be done too.

Two ways come to my mind right now. One using javascript and other adding some logic in that php code, that will check if the url opened is same as the link then apply some css class to it. Checking this for all the links will do what you are saying. Will try to put this into previous code and post.

Mr.Rox’s picture

thx

you are the world greatest

thank you for your helpfulness

Rox

abdullah5588’s picture

Rox, I have added code for doing this. Please check out and leave a comment there too if you could :)

identifying formatting current url from within custom menu

Abdullah

Mr.Rox’s picture

thank you very much it works perfect.

have a nice weekend

Rox