Forcing A Linebreak In The Middle Of A Rank Name

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
Mulsiphix
Registered User
Posts: 181
Joined: Sun Oct 25, 2015 3:14 am
Location: USA
Contact:

Forcing A Linebreak In The Middle Of A Rank Name

Post by Mulsiphix »

I have a very long rank name. It would be nice if I could separate three words onto three separate lines. I tried editing the value in the database too, but <br/> , \n , nor \r worked. Is this possible?

Before
Giraffe Hippopotamus Rhinoceros


After
Giraffe
Hippopotamus
Rhinoceros

User avatar
Steve
Registered User
Posts: 1057
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact:

Re: Forcing A Linebreak In The Middle Of A Rank Name

Post by Steve »

You could use preg_replace() / str_replace() to remove โ€˜ โ€˜ in php or in css set max with and use white-space: prewrap

User avatar
Mulsiphix
Registered User
Posts: 181
Joined: Sun Oct 25, 2015 3:14 am
Location: USA
Contact:

Re: Forcing A Linebreak In The Middle Of A Rank Name

Post by Mulsiphix »

Steve wrote: โ†‘
Tue Jan 14, 2020 8:21 pm
or in css set max with and use white-space: prewrap
This was a great idea. I hadn't even considered that I could touch this with CSS. It worked like a charm! :lol:. In case anyone is interested in the specifics, here is what I did:


Location: styles/prosilver/theme

File: content.css


Find: (Line 724)

Code: Select all

.postprofile dt.no-profile-rank, .postprofile dd.profile-rank, .postprofile .search-result-date {
	margin-bottom: 10px;
}

Replace With:

Code: Select all

.postprofile dt.no-profile-rank, .postprofile dd.profile-rank, .postprofile .search-result-date {
  margin-bottom: 10px;
  white-space: prewrap;
  max-width: 100px;
}

Post Reply

Return to โ€œphpBB Custom Codingโ€