Zacchino
(Zacchino)
February 1, 2017, 10:38am
1
Hello @Everyone ,
Do you guys know of a good working native js script (or jquery or similar) to truncate a text / title length with a specified number of character? Without truncating words (because it’s not readable otherwise).
Example : My long ass title that’s so long it can’t fit to a nice design
Shorten to 30 chars : My long ass title that’s so…
I’d like to be able to apply this rule to any H3 Title with the class “.longtrend” for instance.
Thank you in advance for your help!
vincent
(Vincent Bidaux)
February 1, 2017, 10:44am
2
In case of you dont know about this simple CSS rule:
Hi there,
Is it possible to have text entered into the CMS be truncated once it’s added to the page?
For example I have a field for the client to add in a description of their services and I want to use the first 100 characters of that field as the snippet text on the directory page of their website.
Thanks
And there’s a good read here too:
https://software.intel.com/en-us/html5/hub/blogs/ellipse-my-text/
1 Like
Zacchino
(Zacchino)
February 1, 2017, 10:47am
3
Thanks Vincent,
Actually I just saw your post doing a simple search on the Forum!
It works great, but how do I define how many chars I want before it gets truncated?
Here’s what I have with a 70px width:
What I’d like:
vincent
(Vincent Bidaux)
February 1, 2017, 11:25am
4
It’s an overflow, so it is defined by the container.
CSS-tricks to the rescue?
1 Like
Zacchino
(Zacchino)
February 1, 2017, 11:30am
5
Yay!!!
Merci Vincent you’re so swift and swag… Or shall I say: Shwifty
vincent
(Vincent Bidaux)
February 1, 2017, 11:33am
6
I’m going to have to google all that before thinking anything about it… ;-p
Revolution
(Revolution)
February 1, 2017, 1:16pm
7
awesome. I’ve been looking for something similar. Thanks @vincent
SHWIFTY… ahhh. hm. ok ? PG13 warning.
EDIT… it displayed the text from the site. Replace X with Shwifty
http://www.urbandictionary.com/define.php?term=X
1 Like
vincent
(Vincent Bidaux)
February 1, 2017, 2:24pm
8
Revolution:
Shwifty
LOOOL that was unexpected… still laughing
Zacchino
(Zacchino)
February 1, 2017, 11:06pm
10
@AlexManyeki Nailed it.
Definition: (Spoiler alert)
Being Shwifty /shwifty/ (noun) :
Being the world’s best effort. That’s what.
system
(system)
Closed
April 3, 2017, 8:06pm
11
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.