Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-01 22:48:05

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

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

#2 2011-01-02 05:02:09

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#3 2011-01-02 05:40:12

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: Adding a separate favicon to an admin theme?

Perfect, that’s just what I was looking for. Thank you!

Offline

Board footer

Powered by FluxBB