Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Twig's striptags function as a type for text fields #1911

Closed
Venar opened this issue Nov 6, 2017 · 3 comments
Closed

[Feature] Twig's striptags function as a type for text fields #1911

Venar opened this issue Nov 6, 2017 · 3 comments

Comments

@Venar
Copy link

Venar commented Nov 6, 2017

It would be nice to have 'striptags' twig function as a option for text fields.

If I have fields managed by things like the ckeditor, they often contain a lot of html entities for their formatting. When viewing them in a list view I really only care about the content and a brief blub without the HTML entities would be useful in the list view.

@Venar Venar changed the title Feature Request: Twig's striptags function as a type for text fields [Feature] Twig's striptags function as a type for text fields Nov 6, 2017
@javiereguiluz
Copy link
Collaborator

Just asking: does it make any sense to display the HTML tags on the contents of the list view? Given that we have a raw type that renders the HTML tags, we could apply |striptags by default to the text property. For example:

BEFORE:

{# field_text.html.twig #}
{% if view == 'show' %}
    {{ value|nl2br }}
{% else %}
    {{ value|easyadmin_truncate }}
{% endif %}

AFTER:

{# field_text.html.twig #}
{% if view == 'show' %}
    {{ value|nl2br }}
{% else %}
    {{ value|striptags|easyadmin_truncate }}
{% endif %}

@Venar
Copy link
Author

Venar commented Nov 6, 2017

I think adding striptags to everything text would work for me. When/If I need the html I already use the raw tag, so for menus where I don't want to see that, it would work.

@javiereguiluz
Copy link
Collaborator

I'm closing this issue because we're starting a new phase in the history of this bundle (see #2059). We've moved it into a new GitHub organization and we need to start from scratch: no past issues, no pending pull requests, etc.

I understand if you are angry or disappointed by this, but we really need to "reset" everything in order to reignite the development of this bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants