enonic / app-rss

Apache License 2.0
2 stars 6 forks source link

If excerpt/description is empty, no text is displayed - use part of body! #10

Closed Bellfalasch closed 4 years ago

Bellfalasch commented 7 years ago

If no field for excerpt is found it will come out blank in the feed. Use a cut-out of the full body instead on X words. Make the cutting handle html and such!

pvmerlo commented 7 years ago

In case of HtmlArea input, should we get the content until first

(and obviously closing the tags opened before it) and for TextArea, until the first "\n"?

Bellfalasch commented 7 years ago

I would say the optimal solution is to:

  1. Extract entire body
  2. Strip of html code (we already have a function for that in the controller, it's used for description/summary field)
  3. Cut out the first 80 words (cutting at words gives better results than cutting characters)

Then consider to have an option (checkbox) for this feature, with a selection of amount of words. But I'd say those two settings are smelling version 2.0.