Replace # with entry.title Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this:

&lt;h3&gt;{{ wordBoldTitle|replace({'#':'&lt;strong class="font-weight-extra-bold"&gt;{{entry.title}}&lt;/strong&gt;'} )|raw }}&lt;/h3&gt;


Trying to concatenate the  with the entry.title.
In Twig, you never want to use delimiters inside other delimiters (e.g. {{ ... {{ ... }} }}).

Here's how you would format it instead:

&lt;h3&gt;{{ wordBoldTitle | replace('#', '&lt;strong class="font-weight-extra-bold"&gt;' ~ entry.title ~ '&lt;/strong&gt;') | raw }}&lt;/h3&gt;


What we're doing here is using Twig concatenation (via the ~ operator) to combine our first string (&lt;strong class="font-weight-extra-bold"&gt;), whatever string entry.title results in, and then our second string (&lt;/strong&gt;).

Alternatively we can use string interpolation to achieve this; however string interpolation requires double-quotes, so to do this we'll need to escape the double quotes already in our string:

&lt;h3&gt;{{ wordBoldTitle | replace("#", "&lt;strong class=\"font-weight-extra-bold\"&gt;${entry.title}&lt;/strong&gt;") | raw }}&lt;/h3&gt;




I also changed your replace filter from using a hash (e.g. {'#':'xxx'} to the simpler (at least in this case) comma-separated parameters. The hash works well if you need to replace multiple items, but the comma-separated parameters looks cleaner in my opinion when you only need to replace one item. You can find more about the replace filter formatting here.