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.

Comments

dave reid’s picture

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.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new2.74 KB
dave reid’s picture

dave reid’s picture

rickvug’s picture

For what it is worth the patch for D6 works without any problems.

that0n3guy’s picture

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

dave reid’s picture

StatusFileSize
new3.12 KB
dave reid’s picture

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.

bluegeek9’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (outdated)