Closed (fixed)
Project:
ThemeKey
Version:
6.x-1.2-beta4
Component:
Code / API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2009 at 15:14 UTC
Updated:
13 Nov 2009 at 11:27 UTC
Themekey does not assign the correct theme for pages that exist:
http://cfra.org/marketplace/home
...yet it works for pages that do not exist:
http://cfra.org/marketplace/homexyz
http://cfra.org/marketplace/
Then it works on this page
http://cfra.org/blog
...but not others
http://www.cfra.org/blog/2009/02/09/crystal-clear-tv-unless-you-live-too...
Here are the themekey sttings
blog
blog/#
marketplace/#
Any ideas why?
Comments
Comment #1
HS commentedShould the wild card not be an (*) Asterix? And not (#) Hash?
Comment #2
Village Internet commentedUsing either # or * gave the same results.
We never solved this mystery, but think it could be caused by redirects on the server.
The work-around we used is a good alternative to Themekey, especially if only the header logo needs to be changed (and blocks based on url):
In page.tpl.php place the following code:
This example uses strpos() which is less resource intensive but may run into problems on pages where the url contains both sub strings, eg. http://example.com/marketplace/blog/ may behave like a blog instead of a marketplace. N.B. All code to be further tested and modified.
Note: Now that we've used the above solution, the original links in this posting work fine
Comment #3
vic_d commentedI am sticking my neck out as I am not much of an expert here, but (on system 6.9 as it is set up on my machine/ without pathauto)
whereas < blog > will work for a theme change (using themekey) on the blogs top page because this is indeed the page's name (showing a url like < example.com/?q=blog >), if you move on from there, let's say to a page to see the comments, you see that the following pages are named as nodes like < example.com/?q=node/6 > etc,. It does not indicate blog in the url, now its just a node. < blog/# > is a call to simple numbers (id numbers) within a blog root. But your "blog" root is gone. I think your call has to be more precise and I think that the disappearance of < blog > from the url and its replacement by < node > creates a real problem.
For example, with forums: < forum > will get the top page. To get the succeeding pages which are, in the case of forums, identified by simple numbers, you need to put < forum/#topic_id > , that is the precise ID call. Node identification seems a bit more complicated (probably why theme changes were originally run through taxonomy) and possibly putting a wildcard call on < node > (which may not even be possible as such a call is probably blocked because it strikes me as way too global/ ....) could have far reaching effects on your theme management.
It's an interesting problem though, and I may be needing the answer myself.
(edit/ addenda: might want to look at http://drupal.org/node/45944 = Customizing the full page layout and sections based on node type as well as the Taxonomy Theme module & http://drupal.org/project/blogtheme)
(edit addenda 2, it appears that with the forum example I just gave, the theme change will hold until you get to comments on posts. At which point, "forum" disappears from the URL and the definition changes to "node", so basically the same thing that is happening with blogs: everything after the first posts is run as comments...)
Anybody have an answer to this one?
Comment #4
mkalkbrenner'#' is the wildcard for numbers you have to use '%' for any characters:
blog/%chars_wildcardComment #5
mkalkbrenner