top logged-in-as link

top logged-in-as link

by Przemyslaw Stencel -
Number of replies: 3
I'd like the top logged-in-as link to have a different style than all the other links in my theme. I know that I have to create a class definition in styles.php. But where can I find the piece of code which renders the logged-in-as link (the one at the top of the page)? I'd like to add my class as an attribute of that <a> tag, but can't locate it.
Average of ratings: -
In reply to Przemyslaw Stencel

Re: top logged-in-as link

by Przemyslaw Stencel -
OK, I've found it - it's in the user_login_string function in the weblib.php file. However, as it turns out, the same function is used to render both logged-in-as links, top and bottom (but I need the two links to be different). I'm stuck at this point.

What I was trying to do was to have the top logged-in-as link printed as white text on blue background, and the bottom link as blue text on white background. I think I'll just have to change my artistic vision wink
In reply to Przemyslaw Stencel

Re: top logged-in-as link

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It's quite easy.  The trick is to use the style of the box that the link is in.

For example:

.headermenu a:link {
color: #FFFFFF;
}

.headermenu a:visited {
color: #FFFFFF;
}

.headermenu a:hover {
text-decoration: underline;
color: red;
}


.headerhomemenu a:link {
color: #FFFFFF;
}

.headerhomemenu a:visited {
color: #FFFFFF;
}

.headerhomemenu a:hover {
text-decoration: underline;
color: red;
}