Posted by kazah on May 13, 2011 at 11:21pm
2 followers
Jump to:
| Project: | ThemeKey Properties |
| Version: | 6.x-3.0 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Could you help me to switch theme by "current path". For example, I have a block with main links. They are the same for both themes. But I would like to change the color for this block from the path the user come.
Sorry for my english, its not my native language.
Thanks in advance.
Comments
#1
The current path is accessible by the ThemeKey property drupal:path, which deals with path aliases in drupal internal paths. If you need the path the user is "coming from", try system:referer.
Using ThemeKey Debug you can see the values of these properties on every page's footer.
#2
Thank you very much! It's fantastic. Thank you for your help.
#3
One more question...how can I replace other paths by *. For example, I need system:referer http://mysite/children/* it's mean when user comes to any page from these pages the theme will be switched to what I need.
Not only http://mysite/children/mypath but all paths that have word 'children' in the path.
Thank you.
#4
Unlike drupal:path, system:referer is independent from drupal's internal path system. So you can't use the wildcards '#' and '%'. But you can achieve your feature using a regular expression. Try this rule:
system:referer ~ @mysite/children/@
#5
mkalkbrenner, thank you for your time spending on me.
I think I asked wrong questions...sorry.
Exactly, what i need, is when the user click a link (go to mode 'children') the theme must be switched to "children", and if user go to http://mysite/about the theme is children. But when user click link (go to 'parents') the theme is default.
Thank you, and sorry for my stupid questions.
#6