Separate css for admin pages

garrettperks

Joined: 2009-07-29
Posts: 2
Posted: Wed, 2009-07-29 08:35

I have a theme for albums and photos that I'm very happy with, but it isn't a suitable look for the admin section of the site. Is it possible to have a separate css file for the admin template? Ideally I'd just like the admin section to simply use the Matrix Theme appearance while my albums and photos are styled by the css I've written.

Thanks for the help.

Garrett
garrettperks.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-07-29 09:49

G3 already does this :)

But in G2 here's what I've done.

Site Admin > Themes > Set Matrix as the default theme for the site

Main gallery page, Edit Album > Theme > Set the theme you want for the front facing, public part of the site and have all sub-albums use that them.

Done :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
garrettperks

Joined: 2009-07-29
Posts: 2
Posted: Wed, 2009-07-29 22:41

Thanks for taking time to respond. I appreciate the tip.

The problem with this is that not all admin pages will get the Matrix. For instance, when you are logged in as administrator and go to Edit Album it uses the custom Theme applied to that Album rather than the default theme. This results in the Edit Album pages looking very bad since my custom theme is not very appropriate for the admin pages.

I'm really needing a way to cause the Admin Template to link to a separate stylesheet if it's possible.

Garrett

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2009-07-30 03:36

Does

{if $theme.pageType == 'admin'}
code for your css
{/if}

work?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Mon, 2009-09-28 00:35

I need help with this.

I want all of my admin pages to use the default MATRIX theme, despite the front end to use my custom G2 theme. So far, only my SITE ADMIN pages have the MATRIX theme. How do I assign the Matrix theme also to the USERADMIN and ITEMADMIN pages so all of the backend has a consistent look?

Thanks for any help.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2009-09-28 00:53

Use the matrix theme when admin:
Open theme.inc in your chosen theme's directory, ie. gallery2/themes/customtheme/.
Find the line that sets the theme's ID. It should look something like $this->setId('customtheme');.

Immediately after that line, insert new lines:

	if (($_REQUEST["g2_view"] == 'core.SiteAdmin') {
		$this->setId('matrix');
	}

Save the file, and upload back to the Web server if necessary.
This will change the theme from customtheme to matrix if you are admin.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Mon, 2009-09-28 03:01

Dave,
That worked perfectly, thank you! I have another question, but it's not related to this thread, so I will make a new topic. Hope you can help.

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Wed, 2009-09-30 15:40

Dave, that did it! Thanks.

Now, I guess I can't make the admin backend stay as Matrix?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-09-30 16:37

Here's the answer for that:
http://gallery.menalto.com/node/89433#comment-315646
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2009-09-30 22:22

I might have miss typed the code on this http://gallery.menalto.com/node/89433#comment-322431 . I fixed it so try again.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team