Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Adding a separate favicon to an admin theme?
I’d like for my browser tabs to indicate which are admin-areas. So I opened up the Air theme’s PHP file and noticed that it extends the Classic theme. What’s the best way to add a special favicon to the theme?
Offline
Re: Adding a separate favicon to an admin theme?
Everything that is added to html_head()
will be shown in the <head>
segment of the admin page. So, you would want to extend html_head()
. For example, if I just wanted to add new favicon with a theme:
class myFooBar_theme extends theme {
function html_head() {
return '<link rel="shortcut icon" href="'.$this->url.'favicon.ico" type="image/x-icon" />';
}
}
The function would go inside your theme’s class (you wouldn’t copy+paste the whole thing). $this->url
will return the theme’s location.
Offline
Re: Adding a separate favicon to an admin theme?
Perfect, that’s just what I was looking for. Thank you!
Offline