Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Not a biggie, but a suggestion to have the ability to have the tokens set based on a condition. To check if it is the initial post and if so to use language and tokens something like: created on xx/xx/xxxx by Real Name, if not then: last modified on xx/xx/xxxx by Real Name.
thoughts?
Comments
Comment #1
NancyDruActually, I've had the same thought. For example, if the updated date is not equal to the created date, then add a "changed on..."
I'll have to think about how this might be done.
Comment #2
NancyDruI think the Token module needs to consider this.
Comment #3
gregglesThis is an interesting idea, but I don't think it makes sense for token.
The token module is a simple API for text replacement, not logic.
Logic belongs in code.
Comment #4
NancyDruSo who owns the node token creation? Personally I think there should be a token created there that is the last changed date - and it should be either "created" or "changed," perhaps with a companion token that tells which it was. I agree that it is a "code" issue, but it is a Node issue.
Comment #5
NancyDruMarked #454460: Include "last updated" date as duplicate.
Comment #6
Dane Powell CreditAttribution: Dane Powell commentedSorry for the dupe- subscribing. If I get some free time I'll also try to contribute thoughts / patches to this.
Comment #7
Dane Powell CreditAttribution: Dane Powell commentedThere might be some useful information in #354039: Token logic module patch. I think the consensus is that implementing logic with tokens is redundant, and something that should simply be handled with PHP. So would it be possible to
If so, we should move this back to the Submitted By queue.
Comment #8
gregglesNot in a module I'm involved with. IMO, code belongs in text files.
Comment #9
NancyDruAin't gonna happen in Submitted By either.
But I see no problem with logic creating tokens, as many do now.
Comment #10
Dane Powell CreditAttribution: Dane Powell commentedThat sounds reasonable. I am just curious, why is everyone opposed to using PHP? Is it a security issue? I do in fact agree with the quote mentioned in the other thread along the lines of "why reinvent PHP with square brackets?" Then again I am relatively new to this :)
Comment #11
NancyDruYes, PHP can open up security exposures. It is also not necessarily available.
Comment #12
gregglesAfaik, this is the right status...
Comment #13
NancyDruVery disappointing - this clearly belongs in the node tokens code.
Comment #14
gregglesNothing about this is "clear" other than the fact that Eaton and I both dislike the idea of fancy tokens like this. 1) it's token bloat for a very specific use case 2) it's possible for anyone who needs this to do so in their own modules.
Just because token module is the centralized point for the API doesn't mean that it should also provide every single token.
Comment #15
rajeshfaves CreditAttribution: rajeshfaves commentedMay its an interesting idea... But, not working on all times... try again...
Email Database