e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

{NEWSSUMMARY: limit=xxx} #2416

Open fizi opened 7 years ago

fizi commented 7 years ago

The limit work but I think not good if limit 200 but the text earlier have the point and limit count stop working, (stop on the point). Would be better if the limit (count of characters) ignore the point.

rica-carv commented 7 years ago

Err, you're talking about news summary, right?

fizi commented 7 years ago

yes, {NEWSSUMMARY: limit=xxx}

rica-carv commented 7 years ago

You can change the limit to any number of chars you want. That shortcode can be eassilly customized in a theme_shortcode.php file, so it wouldn't break sentences, to exclude punctuation, etc.

fizi commented 7 years ago

What shortcode need?

rica-carv commented 7 years ago

@fizi The {NEWSSUMMARY} (or in fact, any shortcode) can be redefined inside theme_shortcodes file, to work the way intended by the theme designer....

Moc commented 7 years ago

Yes, but preferably the first step should be to see if it's already possible to achieve the goal by using core shortcodes and parameters.

In case this is not possible, the next step is too look for enhancements to the core shortcodes.

Only after the adjustments have been considered out of scope for the core, then the theme developer should use the theme_shortcodes file to override the core ones.

@fizi: can you please illustrate your suggestion by giving us an example of how it is currently working and how you would like it to be?

fizi commented 7 years ago

I put the image. I set limit=500 (or whatever) after the first point not count the characters more. newssummary_limit If the first point after 20 characters...appears only 20.

rica-carv commented 7 years ago

Might be directly related to line 582...

Since you don't have a news summary for that news, it goes and fetch the news body to generate that summary. What i find odd is that you don't have the final "..." Do you have latest github files?

fizi commented 7 years ago

Yes I use latest.

CaMer0n commented 7 years ago

{NEWS_SUMMARY: limit=50} Does it work for you @fizi ? If so, please close this issue. thanks.

fizi commented 7 years ago

Not work, the problem same.

fizi commented 7 years ago

{NEWS_SUMMARY: limit=xxx} Still it does not work, just shows the text by the end of the first sentence.