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.

AttachmentSizeStatusTest resultOperations
query_tokens.diff2.28 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch query_tokens.diff.View details | Re-test

Comments

#1

Title:token for url query string» Query string tokens
Version:6.x-1.x-dev» 7.x-1.x-dev
Status:needs review» needs work

New tokens will have to be added into D7 first, then backported. This will also need tests.

#2

Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
550164-token-current-page-query-tokens-D7.patch2.74 KBIdlePASSED: [[SimpleTest]]: [MySQL] 66 pass(es).View details | Re-test

#3

AttachmentSizeStatusTest resultOperations
550164-token-current-page-query-tokens-D7.patch1.16 KBIdlePASSED: [[SimpleTest]]: [MySQL] 66 pass(es).View details | Re-test

#4

#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

AttachmentSizeStatusTest resultOperations
550164-query-tokens.patch3.12 KBIdlePASSED: [[SimpleTest]]: [MySQL] 225 pass(es).View details | Re-test

#8

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:needs review» patch (to be ported)

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.