Posted by MGN on August 15, 2009 at 7:51pm
| Project: | Token |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | MGN |
| Status: | patch (to be ported) |
Issue Summary
This patch adds new tokens [query-name] to the tokenSTARTER module that will return the value of the url query field name.
So if the url is http://www.example.com/somepath?nid=4&uid=2 , then [query-nid] would be replaced with 4 and [query-uid] would be replaced with 2.
There have been a couple of requests for something like this in #273893: Argument tokens using arg() and #546958: URL argument placeholder token.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| query_tokens.diff | 2.28 KB | Idle | FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch query_tokens.diff. | View details | Re-test |
Comments
#1
New tokens will have to be added into D7 first, then backported. This will also need tests.
#2
#3
#4
This should probably use http://www.php.net/manual/en/function.filter-input.php for D7.
#5
For what it is worth the patch for D6 works without any problems.
#6
I made a quick module based on the d6 patch above https://github.com/that0n3guy/sts_query_tokens
- tip: use it to easily help quality score in adwords - use page_title.module and nodewords.module
#7
#8
Committed #7 to 7.x-1.x: http://drupalcode.org/project/token.git/commit/0435e1f. Original patch needs to be adjusted to use proper wildcard support.