Skip to main content
Source Link
Tyler
  • 165
  • 1
  • 2
  • 12

using twig | replace filter in a view

I'm using textbox replace in a view for an ICAL and I need to get the special characters to render. Right now calendars like Google Calendar just shows the encoded characters instead of the decoded characters. I want ' instead of this ' .

right now it's not doing anything. I've tried multiple ways to pull this off using |render or using replace | but nothing works. It still just shows up with the encoded characters. example below

{% set special_1 = ''' %}
{% set result_1 = "'" %}
{% set special_2 = '&' %}
{% set result_2 = '&' %}

{{ title_1|replace({ (special_1): result_1, (special_2): result_2 }) }} - {{ field_sport|replace({ (special_1): result_1, (special_2): result_2 }) }}