Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-24 16:05:46

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Configurable path for admin themes (multi-site install friendly)

By default, TXP looks for admin themes on /textpattern/theme/ folder, disregarding of it being a single-site install or a multi-site install (in fact, afaik, a Textpattern install is never aware if it’s single-site or multi-site install).

On a single-site installation, this default location for admin themes is OK.
But, imo, on a multi-site installation, we may need to have different admin themes for different end-users (clients). For example, if you have customized the admin theme with your client’s brand, you may want to make it available only on that client’s site installation.
The way it currently works, all the admin themes at /textpattern/theme/ are available for every TXP install on a multi-site setup.

So, from a filesystem POV, Textpattern looks for admin themes at /path/to/textpattern/theme/ to list them, for example, on the “Admin -> Preferences -> Admin-side theme” dropdown.

On top of that, on a default multi-site install, the way that admin themes are accessible from a web-server POV is by an /admin/theme/ symlink on site’s folder, pointing to /textpattern/theme/.
So, even if the theme path could become user-configurable (or not, but defaulting to /path/to/admin/theme/ on multi-site installs), the way /admin/theme/ is symlinked to /textpattern/theme/ would make all themes available on every install.
IMO, that symlink should be converted into a real /admin/theme/ folder, where we (or end-users) could put/install their private admin themes, and even create symlinks to some widely-available admin themes at /textpattern/theme/.

So, to sum up this request:

  • make the path (txpath var on /lib/txplib_theme.php) to admin themes a configurable option.
  • or, at least, make it default to /admin/theme/ on multi-site installs.
  • make the /admin/theme/ path a real folder (currently, it’s a symlink to /textpattern/theme/ folder).
  • bonus request: remove the symlink at /public/theme/. It seems totally unnecessary to me, unless I’m missing something obvious.

PS: I’m aware that, since v0.27, smd_admin_themes plugin lets you configure (override) a path for admin themes, although it’s not properly working yet.

PS2: I’m not sure what’s the life expectancy for TXP 4.x, nor what are the plans for TXP 5 and multi-site installs, so this request may be arriving a bit late :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2011-06-24 17:28:06

artagesw
Member
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: Configurable path for admin themes (multi-site install friendly)

I agree. And it’s a nuisance that I have to worry about overwriting my theme directory when upgrading.

Offline

#3 2011-06-24 18:52:19

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Configurable path for admin themes (multi-site install friendly)

+1

Offline

#4 2011-06-24 20:20:54

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

Re: Configurable path for admin themes (multi-site install friendly)

Well, you can technically change the theme directory location easily by defining THEME constant in config.php. It will break the default URLs (if pointing to outside web root) created in the theme class, but it can be fixed from the theme itself.

For example I’ve use following small line in config.php.

define('THEME','../../../themes/trunk/');

Offline

#5 2011-06-28 23:11:49

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Configurable path for admin themes (multi-site install friendly)

Gocom, thanks for the suggestion.
I’ve tried it, but although I can “correct” the path to the per-site /admin/theme/ (instead of the general /textpattern/theme/, as you foresaw, it breaks the URLs, as now they point to a non-existing non-accessible path from a web POV).

In the meanwhile, I’ll try hacking smd_admin_themes a little more…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB