I've created a new page template with the filename page-bare.tpl.php, and placed it in the folder in my theme where templates are kept. I cleared all caches, but still nothing shows on the drop-down selector under "Template" except "default."

Thinking perhaps there was a problem locating the template file in the subtheme folders, I copied it into the same folder in the parent theme where templates are kept, and again flushed all the caches. Same result.

What am I missing?

CommentFileSizeAuthor
#9 domain-base-page.diff1.95 KBjohn franklin
#9 domain-base-page-plus-7.diff1.92 KBjohn franklin
#7 node_page.module.patch1.62 KBAnonymous (not verified)
#6 node_page.module.patch1.65 KBAnonymous (not verified)

Comments

escoles’s picture

I also set my theme to rebuild the theme registry on every page load. Doesn't appear to make a difference in behavior.

DenRaf’s picture

You just need to put the template file in the active theme. Then it will be available for selection.

escoles’s picture

I see: It needs to be in the root of the theme folder. If a theme (like AdaptiveTheme) is coded to use a sub-folder to store templates, this doesn't support that.

The theme I'm working with stores its templates in a subfolder:

/sites/all/themes/[theme-name]/[sub-theme-name]/templates/

However, to be recognized by Node Page Template, I have to place them here:

/sites/all/themes/[theme-name]/[sub-theme-name]/

Note also that if there's a file having the same name in the ..../templates/ directory, it will be used in preference to the one that's detected/selected by Node Page Template.

Actually, just testing some things as I write this and it seems that the behavior is much odder than that. I don't want to say too much just yet; want to do some more testing. Suffice to say that it seems pretty inconsistent.

Will test more and come back. I plan to use this module, and need to understand its quirks first.

escoles’s picture

MORE DETAILS

Node Page Template recognizes the existence of templates based on whether it finds them in the root of the theme folder.

But templates are still applied based on the theme's parameters. So if your theme places templates in subfolders (e.g., AdaptiveTheme subthemes, which place templates in a "templates" subfolder), you seem to need to have two copies of the template file: one in the root, and one in the subfolder.

I'm not sure whether this is by design or accidental -- not sure what to make of it. At this point, for my situation, it's just an undocumented configuration requirement.

Also, if you move the site to another server or do SQL exports from production for development (or vice versa), you should be careful to clear your theme registry before you dump the database. Having multiple template files with the same name in the "wrong" places can result in an apparent WSOD [white screen of death] with no logged PHP errors (trying to load update.php will show you the errors, though).*

--
*Aside: I got into this situation, I think, because both my presentation and admin themes are sub-themes of a parent. If I were using completely discrete admin and presentation themes, this might not have happened. Not relevant to this issue, but relevant to recovering from it, so I mention it.

aschiwi’s picture

I second this request. I like to keep clean template files, some themes are really big and have lots of theme files that I organize in page, views, node and cck templates for example. Would be cool if this module supported this.

Anonymous’s picture

StatusFileSize
new1.65 KB

This patch adds traversing through subdirectories.

Anonymous’s picture

StatusFileSize
new1.62 KB

and here's a patch that lists all .tpl.php files in the active theme

theargument’s picture

Title: Doesn't recognize template files » Doesn't recognize template files - additional issue

Further to these posts / patches - I'm using Genesis as my base theme and developing a subtheme - I've run the patch to include the subdirectory info in the theme path BUT it's causing a WSOD.

I think this is because the theme I'm using isn't the default - instead it's a development theme for a redesign that I'm running alongside the existing (default) theme) - so the node_page template listing is coming from the default theme (which anonymous users get to see) and not the active theme (which site admin gets to see)...

I'm pretty sure this shouldn't be too hard to fix but my PHP just ain't up to it... would be great if someone's was though.

Thanks in advance to any kind soul who fixes it for me!

john franklin’s picture

StatusFileSize
new1.92 KB
new1.95 KB

Attached patch adds:

  • Domain Theme support
  • Scans base themes
  • Limits to *page.tpl.php

domain-base-page.diff requires #7 to be applied first.
domain-base-page-plus-7.diff incorporates #7.