PHPTemplate goes to the work of including hard-coded HTML for a default full page view. This can be styled via CSS, but the directory scanning function it uses to detect installed themes ignores anything that doesn't include a page.tpl.php.

Since the engine provides a default page, this restriction seems unecessary. It's also breaking a relatively simple pure CSS theme I'm working on -- I could include a dummy page.tpl.php, but that would violate the whole purpose of demonstrating that Drupal is super-skinnable. ;)

The following EXTREMELY simple patch removes this blind spot, and detects themes that have a page.tpl.php, a template.php, or a style.css file. The presence of at least one of those should be enough to find any theme.

CommentFileSizeAuthor
#3 theme_scan_0.patch1.03 KBeaton
theme_scan.patch719 byteseaton

Comments

eaton’s picture

Status: Needs review » Needs work

Meh, scratch that -- when this pattern is used, PHPTemplate itself shows up as a theme.

quicksketch’s picture

+1 Seems fair enough. With PHP short circuiting the 'OR' logic here anyway there will be absolutely no performance difference.

I also like the idea that a designer could be saved the trouble of any unnecessary php files. Dramatic renactment: Programmer: "Then you just open up the .tpl.php file..." Designer: "C-syntax language, AAAA! Help! Panic!"

Well... you get the idea. ;-)

eaton’s picture

StatusFileSize
new1.03 KB

This version of the patch works perfectly, BUT it requires that a themename.info file be placed in the theme directory. We could key off of a template.php file instead, or any other file... The real problem is that we should provide a default HTML layout and allow themes to *use* it, just skinning as necessary.

The inability to create a 'pure' CSS theme is a definite stumbling block, and one that's giving me problems with a client project that depends on extensive multi-site support with slim themes for each different multisite install.

I'd really love to see this 'blind spot' be resolved in some way...

coreb’s picture

Version: x.y.z » 5.x-dev

Moving out of the "x.y.z" queue to a real queue.

eaton’s picture

Status: Needs work » Fixed

This is possible now using .info files in Drupal 6.

Anonymous’s picture

Status: Fixed » Closed (fixed)