- Issue created by @juc1
- 🇮🇳India rohitsharma401
{# Check if the field has content #}
{% if content.field_long_text %}
{# Display the trimmed version of the text #}
{% set trimmed_text = content.field_long_text['#text']|slice(0, 200) %}{% endif %}
i think you are trying to do like this , but by this you will be redirecting to the page or node url only where you can get the full content of the page .
You need to work with JS for showing the whole content in the same page by clicking on the "Read More" button .
- Status changed to Needs review
3 months ago 5:57pm 22 August 2024 - 🇺🇸United States markie Albuquerque, NM
This is outside of the scope for the smart_trim module. You are attempting to hide and show. You could do something like print the trimmed text and the full body text in separate divs, hiding the full body. Then when the more link is clicked, it toggles the visibility via JS.