- heddn Nicaragua
I'm sure the implementation between D7 and D10 is a little different. But a smart trim token for summary fields is actually a missing feature-set in D10 too. And since the life-support for D7 is so short at this point, I'm going to just move versions and work on a version of these functionality for the 2.1.x version.
- Status changed to RTBC
7 months ago 4:47pm 4 June 2024 - 🇺🇸United States akalata
Works as expected, though I'm not sure about the assumption of a `token` view mode -- but I think that's more of a foundational approach with "how do we handle tokens that might need to respond to settings?".
- heddn Nicaragua
The 'token' view mode logic is exactly what
token.module
assumes. It seems like that assumption was a safe one to continue using here too. - First commit to issue fork.
- Status changed to Needs work
5 months ago 6:52pm 23 July 2024 - 🇺🇸United States ultimike Florida, USA
Thanks everyone for pushing this issue forward, and also for your patience for one of this module's slacker maintainers finds the time to check it out (present company included).
First off - this needs a test. @markie and I have been really trying to require tests for all feature additions and bug fixes, so this would be no exception. I think a functional test would be pretty straight-forward...
I manually tested this using Gitpod with a few of our DrupalEasy alums and all appears to work as expected. The only thing I would make note of (possibly with an update to the README and/or docs) is the fact that the Token view mode must be enabled and configured with a Smart Trim formatter (for the field(s) in question) or the Smart Trim tokens aren't really involved.
Regardless, we tested Smart Trim tokens with Pathauto and Metatag with everything working as expected.
I went ahead and committed @heddn and @akalata's suggestions, as well as a PhpStan ignore for renderPlain() in smart_trim.tokens.inc (see 📌 Handle renderPlain() deprecation Active ).
-mike
- Status changed to Needs review
5 months ago 3:09pm 24 July 2024 - Status changed to Needs work
5 months ago 4:54pm 29 July 2024 - First commit to issue fork.
- Status changed to Needs review
5 months ago 2:47pm 31 July 2024 - heddn Nicaragua
This should now be green, except for Drupal 11 support. Which is still not functional on HEAD.
- 🇮🇳India ankitv18
ankitv18 → changed the visibility of the branch 2.1.x to active.
- 🇮🇳India ankitv18
ankitv18 → changed the visibility of the branch 2782455-smart_trim_summary_token to active.
- 🇮🇳India ankitv18
ankitv18 → changed the visibility of the branch 2.1.x to hidden.
- 🇮🇳India ankitv18
ankitv18 → changed the visibility of the branch 2782455-smart-trim-tokens-7.x to hidden.
- heddn Nicaragua
In #39 thought I had it figured out why tests are failing on pre 10.2. They pass successfully on local 10.2, just not on the testbot. Since 10.1 is no longer supported and this is a new feature, I feel quite happy to simply skip execution on old drupal versions (that's what we do now). It results in the same work later since in both cases we'd have pre 10.2 logic that would need to be removed.
- Status changed to Needs work
5 months ago 9:02pm 1 August 2024 - 🇺🇸United States ultimike Florida, USA
I changing this to "needs work", but for any serious reason - only because I have a question about the test logic that I couldn't figure out on my own...
thanks,
-mike - Status changed to Needs review
5 months ago 10:01pm 1 August 2024 - Status changed to RTBC
5 months ago 7:58pm 4 August 2024 - 🇺🇸United States markie Albuquerque, NM
Tested in Drupalpod with metatag and it seems to be working well. Was able to update the metatag description with a token.
- Status changed to Fixed
5 months ago 11:16pm 7 August 2024 - 🇺🇸United States markie Albuquerque, NM
Merged and prepping for the next release.
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇬🇧United Kingdom jacobupal Leeds
I've just tried this out and while
[node:body-smart-trim]
alone will work, when I use it as a meta tag description[node:body-smart-trim:160]
i.e. including a max-length value, it does not. The page simply loads without the appropriate meta tag present. Presumably because "[node:body-smart-trim:160]" could not be found.So two questions:
- Am I using the token correctly?
- If I can't enter a character limit, what the default character limit being used?
- 🇺🇸United States ultimike Florida, USA
@jacobupal,
No, tokens that include a max-length value are not supported.
When using the new Smart Trim token, the max value (and the rest of the settings) will come from the Token view mode of the entity (if specified) or fallback to the default view mode settings.
-mike
- heddn Nicaragua
Exactly what Mike said in #53. That is how core tokens work too. This is just following that precedent.