By Alan Niven on Wednesday, 30 July 2014
Replies 9
Likes 0
Views 1K
Votes 0
I'm not sure why the code for frontpage truncation by word was written to condense all the paragraphs of the top text. In my opinion it makes the truncate by word option under settings >> layout unusable. (Also messes up the Facebook share system post.)

The <p> and <br> options are also less than ideal too. We have over 100 bloggers on our site and there is no way to train all of them to make sure all they only use one method of making paragraphs. Most write off line and paste into the editor.

My suggested solution would be to include use word count, that way blog intros have similar visual weight, but leave the <p> or <brr> formatting in place. Alternatively when the option is set to count paragraphs, have an one option that counts either a <p> or a <br><br> combo as a paragraph.

Maybe others can lend their input on how best to make truncation consistent on a wide variety of conditions.
Thanks for the heads up on this
·
Saturday, 09 August 2014 01:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Alan,

There is no proper way to use word / character count without messing up with the html structure. We have tried this and there are just too many different possibilities to break things. We have to strip out the html codes to avoid breaking the entire layout.
·
Wednesday, 30 July 2014 11:18
·
0 Likes
·
0 Votes
·
0 Comments
·
How about the second suggestion of counting both <p> and <br><br> codes as one paragraph?

Since your coders all ready know how to count either of these cases, could they combine both methods into one option in setting?

The dual option would fix most of the single option problems.

Alan
·
Thursday, 31 July 2014 01:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Alan,

How do you determine it as one paragraph my mixing the paragraph and break tags? Not really sure where you are heading with this. The contents are comprimised of paragraph and break tags. If you treat all these as one paragraph then there will never be another paragraph in the content.
·
Thursday, 31 July 2014 14:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Your coders all ready know how to count paragraphs when the I select in your drop down menu:
Truncation type: By paragraph <p> or By Break Tags <br>

So what I'm suggesting they do is add an additional selection to that menu which would essentially "OR" those two code snippets so EB would count either <p> tags or <br> tags when determining a paragraph. This should be easy to do by recycling and adapting some existing code.
·
Thursday, 07 August 2014 02:15
·
0 Likes
·
0 Votes
·
0 Comments
·
It doesn't make sense Allen. A break tag can appear in a paragraph. Well imagine this,

<p>some<br/><br/><br/>text here<br /></p>
·
Thursday, 07 August 2014 14:13
·
0 Likes
·
0 Votes
·
0 Comments
·
I would convert any pair of consecutive <br /> or <br> to a <p> and ignore the remaining single <br/>s. So in your sample would be parsed as: <p>some</p><p>text here</p>

some

text here

For a total of 2 paragraphs.
Basically I would treat the consecutive <br/><br/> as a <p> and throw away the two other remaining single <br/>s.

It may not be perfect in handling all html code, but I think it would be much better than stripping out all formatting or handling <p> and <br/><br/> separately.

Alan
·
Friday, 08 August 2014 01:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Alan,

It's not possible to just convert it that way as it would be extremely heavy to scan every single word in a paragraph. Anyway we'll see what can be done but I don't really think this idea makes sense.
·
Friday, 08 August 2014 10:05
·
0 Likes
·
0 Votes
·
0 Comments
·
The scan would only need to take place on posts that did not already have a "Ready More" flag set.

If the "Read More" flag was not set, the scan would take place once when published and a "Read more" break could be inserted in the calculated spot between paragraphs.

Food for thought.
·
Saturday, 09 August 2014 00:31
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post