0

I am using Drupal 8.1.3 and in simple views I want to use rewrite feature of views, and I put <span class="stats">{{ totalcount }}<i aria-hidden="true" class="fa fa-eye"></i></span> in rewrite section and on out put I see

enter image description here

Where is the problem and why view template engine not render HTML in rewrite section?

UPDATE Exactly it that views I try rewrite title field and for it works correctly is seems problem is with statistics total view field !!!

2
  • Can you provide which templates are you using to override your views fields? Jul 3, 2016 at 17:16
  • @darol100 I used boostrap theme, but it's not relate to theme because I have the same in the views preview.
    – Yuseferi
    Jul 3, 2016 at 21:56

1 Answer 1

1

I think it could be because of the <i>....</i> tags part, if you take that out, does it render? Seems like views uses Filter HTML, and only popular html tags are allowed on Custom Fields or Re-Write boxes.

You should be able to achieve your goal by creating a template file.

views-view-fields--[view-name]--[machine-name].html.twig

<span class="stats">{{ fields.totalcount.content }}<i aria-hidden="true" class="fa fa-eye"></i></span>
1
  • 1
    Thanks for you attention, it was because statistics field, I try ti add global unformated field then put <span class="stats">{{ fields.totalcount.content }}<i aria-hidden="true" class="fa fa-eye"></i></span> and work correctly. it seems it is a issue in statistics module
    – Yuseferi
    Jul 4, 2016 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.