Hi,

recetly I found your great module and it took me a while to discover the way to achieve really simple (and widely-used) use case:

  • switch theme according to path alias

Then I went through your docs and examples and at the wildcard paths I found only TODO :-D Please use this image as an example - found it in issue queue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ShaneOnABike’s picture

+1 it's not that easy to understand :/

mkalkbrenner’s picture

The feature is documented within the help section in included in the module:

Query parameters are stripped off before the path gets examined. P.e. "node/add/story?destination=node" becomes "node/add/story" first. If you want to access query parameters have a look at the system:query_param property provided by ThemeKey Properties.
Wildcard characters are "#" for numeric parts and "%" for all characters. To match conditions against a certain part, use an identifier with the wildcard. For example "comment/reply/#xyz" matches all paths with "comment/reply" and a numeric third argument. You can then specify conditions for every wildcard argument using the property "drupal:path:wildcard" and the identifier you choose ("xyz" in this example).
These are the possible wildcard replacements for foo/bar/42/test.html:
foo/bar/42/test.html
foo/bar/42/%
foo/bar/42
foo/bar/%/test.html
foo/bar/%/%
foo/bar/%
foo/bar/#/test.html
foo/bar/#/%
foo/bar/#
foo/bar
foo/%/42/test.html
foo/%/42/%
foo/%/42
foo/%/%/test.html
foo/%/%/%
foo/%/%
foo/%/#/test.html
foo/%/#/%
foo/%/#
foo/%
foo
%/bar/42/test.html
%/bar/42/%
%/bar/42
%/bar/%/test.html
%/bar/%/%
%/bar/%
%/bar/#/test.html
%/bar/#/%
%/bar/#
%/bar
%/%/42/test.html
%/%/42/%
%/%/42
%/%/%/test.html
%/%/%/%
%/%/%
%/%/#/test.html
%/%/#/%
%/%/#
%/%
%

The important part is

For example "comment/reply/#xyz" matches all paths with "comment/reply" and a numeric third argument. You can then specify conditions for every wildcard argument using the property "drupal:path:wildcard" and the identifier you choose ("xyz" in this example).

But you're right that this is sophisticated stuff and an exmple / tutorial is required. That's the TODO you've found.

If anyone has some time to spent on such a tutorial, you're welcome!

The screenshot you mentioned is not suitable because it uses a regular expression which is to complicated to understand for beginners. In this screenshot '/' are the delimters of the regex and have nothing to do with the path.

patoshi’s picture

i still dont get it.. what do i put when i choose path:wildcard there are 2 input boxes.

I am trying to match these two:

/procure
/procure-sell
/procure-store

I'm trying to do this: procure%

but that doesnt work it seems. wildcard needs more documentation as its quite confusing.

Thanks and great work~!

Michael Ware’s picture

Version: 6.x-3.2 » 7.x-1.0
Category: feature » support
FileSize
30.05 KB
30.05 KB

I keep reading/hearing that Themekey has wonderful documentation, but I can't find it anywhere. I don't see all of the examples featured in the Mustardseed tutorial, http://mustardseedmedia.com/podcast/episode52, Any suggestions, both online or somewhere in my admin section?

More specifically, I would like to set a wildcard alias for all URLs in a given directory so that they use the same theme, but am not sure how to configure the settings.
Ex: www.example.com/apples and /apples/* should have the apples theme. I know to use % instead of *, but still not getting anywhere.

drupal:path:wildcard mysterious empty box = apples/%

What goes in the mysterious empty box?

Thx.

mkalkbrenner’s picture

The documentation is included in the module itself. Please check the Help section of your drupal installation.

In your case, the rule is simple:

drupal:path = apples >>> apple theme

This one matches "/apples" and "/apples/*", if you think of natural wildcards and paths.
Please note that a wildcard like "*" dosen't exist in ThemeKey. I know that it might be difficult to understand but that's how drupal's internal menu / path system works.

The mysterious empty box after drupal:path:wildcard is for "named wildcards" previously declared in a drupal:path rule. But please check the documentation for that.

Michael Ware’s picture

Great. Thx for the reply!

mkalkbrenner’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

I close this issue to clean up the queue. But we have to keep this in mind when writing the handbook ...

reallyordinary’s picture

Wildcard paths still don't make a lick of sense. Cannot make heads or tails of the help text.