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

Entry titles (in the control panel) should support the <wbr> tag #1633

Closed
1 task
nathanvanbakel opened this issue Dec 9, 2021 · 4 comments · Fixed by #2345
Closed
1 task

Entry titles (in the control panel) should support the <wbr> tag #1633

nathanvanbakel opened this issue Dec 9, 2021 · 4 comments · Fixed by #2345

Comments

@nathanvanbakel
Copy link

Description

When using a longer word in a title I would like to inform the browser of a possible breaking point use a <wbr> tag.
However, when I use the <wbr> tag I get an error message:

This field can only contain the following HTML tags: b, cite, code, del, em, i, ins, markspan, strong, sub, sup. If you want to use angle brackets < in your text, but not HTML please try &lt; to replace < and &gt; to replace >.

Solution

I would like the title field to accept the <wbr> tag.

Example

Supercalifragilistic<wbr>expialidocious

Alternatives

Don't use the title field - use a custom field instead.
Don't use the control panel - use a custom build entry form instead.

What about...

Using the title of an entry is quite excellent in the <title>Supercalifragilistic<wbr>expialidocious</title>
But we wouldn't want those tags visible in the page title. This means the site creator needs to add extra code to remove it. Either using an addon (striptags) or by using the build in php functionality.

  • I am capable and would like to work on implementation of this feature if it is considered.
@intoeetive
Copy link
Contributor

intoeetive commented Dec 10, 2021

It looks like only formatting tags are accepted for titles, and not the line breaks.

@robinsowell @ajohnson do you think <br> and <wbr> should be allowed in entry titles or not? Allowing those would also have implication of added line breaks in CP Entries table

@robinsowell
Copy link
Contributor

Hrm. Well his 'What about' is dead on, but since it applies to tags we already allow- bold, etc- not an impediment.

I would tend to prefer to leave that to our design as far as the cp goes, though. I can see it causing issues if/when we change things up or have certain expectations or whatever. So- totally defer to @ajohnson . It's one I can definitely see the pros/cons.

@ajohnson
Copy link
Contributor

@intoeetive @robinsowell I can definitely see the use case here.

As far as the CP goes, I'm assuming adding a <wbr> or <br> tag to an entry title would simply display those tags as part of the title anywhere entry titles are displayed in the CP, similar to how a title's <b> tag is currently displayed in the CP:

Screen Shot 2021-12-17 at 1 34 01 PM

If that's the case then we shouldn't have much to worry about by honoring <wbr> and <br> tags in entry titles. They'll be displayed as tags in the CP (without rendering their formatting), but on the front-end the formatting of those tags will be rendered.

But it does seem odd that line breaks are not currently included in the list of available tags. That feels like a deliberate decision made at some point in EE's history.

@TomJaeger Any reason (historical or otherwise) you can think of for not implementing line breaks?

@intoeetive
Copy link
Contributor

As per @ajohnson we're fine adding <br> and <wbr> to allowed tags list for titles.

@nathanvanbakel please feel free to submit a PR for this

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