By Guest on Monday, 15 May 2017
Replies 15
Likes 4
Views 1.3K
Votes 0
Is there a possibilty to solve this via template override?

Regards

Thomas
I'm really sorry - there was a silly typo in my code I've tested this on some Korean text and it appears to work ok.
·
Tuesday, 23 May 2017 10:14
·
4 Likes
·
0 Votes
·
0 Comments
·
Hello,

The HTML has to be stripped. If it isn't then you truncate before a html tag closes your whole page is messed up.

What are you trying to do exactly?

Many thanks
Tony
·
Monday, 15 May 2017 21:15
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi Tony,

It's just about allowing some tags like <br> <b> <h1> <a>
·
Tuesday, 16 May 2017 08:57
·
4 Likes
·
0 Votes
·
0 Comments
·
Hello,

But if you do that and it is truncated before </b> then your whole site is in bold. It's just not possible with a truncation by number.

You could instead add a Custom Field HTML which you could duplicate text which isn't truncated and users set the output they want for list views in here.

Many thanks
Tony
·
Tuesday, 16 May 2017 10:07
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi,

Yes I know that, but in my case I would have to add an additional Field for the introtext which would only be visible in the category list views. So the main Editorfield must be disactivated for this view.
For all new events this would be ok but for all old events it's a bit difficult.
·
Tuesday, 16 May 2017 14:58
·
4 Likes
·
0 Votes
·
0 Comments
·
This MAY be possible using a word count and this function https://github.com/judev/php-htmltruncator but I can't guarantee that it would work.

Would counting on words be ok?
·
Wednesday, 17 May 2017 14:05
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint

Counting on words would be fine for me.
·
Wednesday, 17 May 2017 14:14
·
4 Likes
·
0 Votes
·
0 Comments
·
Please unzip and upload this file to components/com_jevents/views/default/helpers/defaultloadedfromtemplate.php and then use
{{Truncated Desc:TRUNCATED_DESC:20 words}}

in the layout
·
Friday, 19 May 2017 10:12
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint,

This is great! Generally this works but it has some problems with special characters.
http://kultur-schloss-seefeld.de/klassik.html

Also I had to set images to display:none;
·
Saturday, 20 May 2017 11:12
·
4 Likes
·
0 Votes
·
0 Comments
·
Try this version - it should deal with the UTF-8 character issue.
·
Monday, 22 May 2017 10:29
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint,

This is strange. It seems that the first 2 letters are stripped and special characters are not displayed correctly.
http://kultur-schloss-seefeld.de/klassik.html
·
Monday, 22 May 2017 13:13
·
4 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint,

Sorry I just managed now to install your new file. Thanks a lot, this seems to work correct.

Regards

Thomas
·
Tuesday, 23 May 2017 22:25
·
4 Likes
·
0 Votes
·
0 Comments
·
Good to hear - I'll include these changes in the next release of JEvents.
·
Friday, 26 May 2017 10:19
·
4 Likes
·
0 Votes
·
0 Comments
·
Perfect!
Did you keep in mind that I disabled images via CSS? Otherwise the image tag would be visible as text when cutted in parts.
·
Friday, 26 May 2017 10:28
·
4 Likes
·
0 Votes
·
0 Comments
·
The code is simply designed to ensure that the truncated HTML is valid HTML - it will probably leave images intact so you will need to keep your CSS changes.
·
Friday, 26 May 2017 11:44
·
4 Likes
·
0 Votes
·
0 Comments
·
View Full Post