Forum

Thread tagged as: Question, Problem, Suggestions

Categories title to ignore HTMl in backend

Hi Guys,

Not sure if this is a bug, an oversight or if I am not doing something 'right'. But I have created some categories. For the front-end I need to display these with specific line breaks in between certain words for visual presentation. So I added html="true" to the catTitle field and added <br>'s as I needed them. The problem is that this is used within the backed, so the title contains a line break, which looks a little odd. See here; https://cl.ly/image/3h3Q3p0S3N3E

Just thought I would mention it as I saw it. perhaps the CatTitle needs to strip html tags for the backend?

There are going to be instances within my code where I will need the catTitle without the <br> - I was going to use the striptags="true" command on those template items. But do you think there is a better to approach this whole solution?

Cheers Terry

Terry Upton

Terry Upton 0 points

  • 7 years ago

Also notice it uses them here too... https://cl.ly/image/083N0z1b1M40

Drew McLellan

Drew McLellan 2638 points
Perch Support

The correct behaviour is that Perch should be encoding the markup. The title case is incorrect.

Hi Drew. What was the outcome of this thread? Did you mean it was a bug and shouldn't output the HTML in the backed?

Thanks Terry

Drew McLellan

Drew McLellan 2638 points
Perch Support

The case where the <br> is treated as HTML is a bug.

Thanks Drew. Will this be fixed in a future update?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it's been fixed.

I still see it in 2.7.3. So I assume it's ready for one you have not released yet?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which part are you seeing?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Great - that's correct.

Oh right, is it? Sorry. I thought it would not show the HTML at all in those fields.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Those fields don't support HTML, so it's presented as text.

Thats ok. I had assumed (perhaps incorrectly) it would just strip tags so no HTMl or HTML text was shown. It's ok though. Thanks Drew.