- 🇮🇪Ireland lostcarpark
Is this something that could be incorporated into twig template? If it could be achieved with Twig variables, that would seem cleaner and more flexible.
- Status changed to Closed: duplicate
about 1 year ago 4:21pm 8 June 2023 - 🇺🇸United States markie Albuquerque, NM
This can be resolved by extending the twig template. Closing.
- 🇮🇪Ireland lostcarpark
I wonder is there enough to close this yet? I was thinking a "remainder" variable containing the trimmed text would be needed?
- 🇺🇸United States ultimike Florida, USA
Markie and I discussed this at DrupalCon Pittsburgh and we really want to limit the formatter configuration options - we want to reduce them, if possible.
But, if there is a variable we can make available to the new smart-trim.html.twig template, that would be worth considering.
@georgebrook or @lostcarpark - I'm not clear on else we would need to make available in the template file for this request to be achievable. Perhaps an example would help. Am I thinking about this correct in the following example?
Full body text:
But we’ve met before. That was a long time ago, I was a kid at St. Swithin’s, It used to be funded by the Wayne Foundation. It’s an orphanage. My mum died when I was small, it was a car accident. I don’t remember it. My dad got shot a couple of years later for a gambling debt. Oh I remember that one just fine. Not a lot of people know what it feels like to be angry in your bones.
Trimmed text:
But we’ve met before. That was a long time ago, I was a kid at St. Swithin’s, It used to be funded by the Wayne Foundation.
Remainder text:
It’s an orphanage. My mum died when I was small, it was a car accident. I don’t remember it. My dad got shot a couple of years later for a gambling debt. Oh I remember that one just fine. Not a lot of people know what it feels like to be angry in your bones.
Do I have this correct?
If so, can this use case be achieved by just adding a "remainder" variable to the twig template, as @lostcarpark suggests?
-mike
- 🇺🇸United States markie Albuquerque, NM
I like the idea of the remainder variable but that is outside the scope of this request (in my opinion). A good use case for the remainder capture would be trimming, and then expanding on the same page. This would lead to the SDC example I was talking about as well. Of course that means we would probably bump this feature to a 3.x version for >10.1....