im trying to load in different template files for panels

theme.info
skinr[extras][templates][] = foo
skinr[extras][templates][] = bar

but theres no love from panels :/

Comments

jacine’s picture

I've also noticed that I cannot put templates (for any hook) in subfolders, i.e. templates/my-template-block.tpl.php

Can we try to fix this?

jacine’s picture

Assigned: Unassigned » moonray
moonray’s picture

Component: Code » Documentation
Category: bug » task
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

The panels template problem is fixed in CVS.
The issue with subfolders... drupal automatically searches for folders in a theme that contain .tpl.php files so there's no need to prepend the folder name. If you do, however, it will strip the slash and you will wind up with a template of templatesmy-template-block.tpl.php which is not what you want.
There are two solutions for this:
1. document it
2. strip any folders to make themers not have to think (though the overhead shouldn't be needed since the template files behavior is core drupal)

jacine’s picture

Thanks Bala, I'll have to test this. I definitely don't want to prepend the directory. It just wasn't working last time I tried to drop a tpl in a subdirectory.

jacine’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)
jacine’s picture

Priority: Minor » Normal
Status: Patch (to be ported) » Needs work

Ok, this is still not working (for panels). The blocks issue I mention is fixed.

It was hard to tell what the code was that corrected this in the commit log, so this may not be all of it. I applied the following to the 6.x.1.x branch to test:

-    if (drupal_substr($template, (drupal_strlen($preprocess_hook) * -1)) == $preprocess_hook) {
+    if (drupal_substr(str_replace('_', '-', $template), (drupal_strlen($preprocess_hook) * -1)) == str_replace('_', '-', $preprocess_hook)) {

In panels am able to see and select a custom panels tpl file in the panels UI ONLY if that custom tpl is inside the root directory of the theme folder. If the file is in a subdirectory, I can't even see it in the UI. Either way the custom template file is not actually used.

Test files have been added to our dev site, which has been switched back to running 6.x-1.x.

@Bala, please commit these changes (bug fixes) as you go to both branches. Trying to figure this out by looking at the commit log and diffs is inefficient at best, especially when the commits have other unrelated changes, and it ends up wasting a lot of precious time.

jacine’s picture

This has been committed to DRUPAL-6--1 (dev branch) in the meantime.

jacine’s picture

Version: 6.x-1.1 » 6.x-1.4
moonray’s picture

Status: Needs work » Fixed

There was an issue where panels wouldn't save Skinr settings if you clicked the (newly added) "Update and save" button on panels' edit content page. Fixed in CVS.

This allows us to now properly save Skinr settings, which makes the above fix actually work properly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.