Limit dynamic Title / Text length

I’ve added a text element that pulls data from a custom ACF field. So far so good. However, i would like to limit the length of the text, so long texts don’t extend too far. Similar to how The Excerpt works. {{dc:post:excerpt length=“24”}}…

I’m currently doing it like this:

window.addEventListener('DOMContentLoaded', (event) => {

    var titulos = document.querySelectorAll('.blog-titles'); 

    var limite = 200; 

    titulos.forEach(function(titulo) {
        var texto = titulo.innerHTML;

        if (texto.length > limite) {
            titulo.innerHTML = texto.substring(0, limite) + '...';
        }
    });
});

Maybe something like this?
{{dc:post:title excerpt=“4” lenght=“6”}}

If not how can I make a feature request?

With our Twig integration you can use the u.truncate filter to limit the length of text. Make sure String Extra is enabled in the Theme Options as well. For what you are doing with title it would look like this. Have a great weekend.

{{ post.title | u.truncate(10, '...') }}