Would it be possible for the module to provide a token such as [node:shorturl] for use in other modules supporting Token functionality?

In particular, I'd like to be able to post to Twitter using Rules, and whilst the Twitter module allows for a short URL to be generated, I've not worked out how to get a Rule to do it, whereas just adding [node:shorturl] to the message content would be easy!

Comments

icecreamyou’s picture

%node_url doesn't do it? Alright then, sounds reasonable. It will probably be a few weeks before I get to it though.

mpettitt’s picture

Seems to depend on the module as to which use [] style tokens and which use %, and which support both... Is very confusing - I did have a go at adjusting the tokenSTARTER module to handle it, but it only worked in PathAuto (which isn't terribly useful, but was the only other module I had to hand to test on), while Views completely ignored it...

icecreamyou’s picture

In general, tokens that use square brackets are those that integrate directly with the Token module. Tokens that use the percent sign, the at symbol, or an exclamation point are generally handled by the provider module (not Token). From a non-coding standpoint, tokens marked by the at symbol or exclamation point are usually just replaced normally, while the percent sign tokens are often replaced and emphasized.

icecreamyou’s picture

Status: Active » Fixed
mpettitt’s picture

Just updated and it seems to work perfectly! Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

summit’s picture

Hi, Would love to have this token in Drupal 7!
Greetings, Martijn

summit’s picture

Hi, sorry didn't see: http://drupal.org/node/1247888 yet.
Greetings, Martijn