feature request/bugfix - recent entries plugin

Creating and modifying plugins.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

feature request/bugfix - recent entries plugin

Post by carl_galloway »

Hi all,

I recently discovered that the recent entries plugin does not play well with posts that have no title. I've been playing with different 'wrong' things that users can do to break a theme, and whilst I have found a fix for entry titles, as below;

Code: Select all

<h4 class="serendipity_title"><a href="{$entry.link}">{$entry.title|@default:$entry.body|truncate:40:" ..."}</a></h4>
I have not been able to do anything with the recent entries plugin. Is it possible to either truncate the entry body like I've done in my entries.tpl, or at least put the entry id in. Without a title or id the link to the post obviously doesn't work, which leaves you with a date on its own, and no way of reading that particular post. See my themes website for the page.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: feature request/bugfix - recent entries plugin

Post by garvinhicking »

Hi!

This is not as easy as it sounds. The problem is within the recententries plugin, the entry body is not available. Fetching it would mean a considerable overhead.

So we only have the timestamp and the id and an empty title. I've now inserted the "#XXX" ID inside the link...

Regards,
Garvin[/list]
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

How about checking for blank title when the entry is saved, and forcing a title if none exists?
Judebert
---
Website | Wishlist | PayPal
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Guys, sorry to be such a pain in the ass, I know you probably didn't plan on doing half the stuff I've been pushing for, but on the other hand just think how cool s9y will be ....

Carl
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

There is a plugin "entrycheck" that can check for empty titles, but this of course doesn'T solve Carls initial trouble.

I'm afraid, for that singular issue a fix is just too expensive for the little benefit it would IMHO bring. Blog entries without titles are rare. They also make trouble in RSS reader...and why would anyone do that for real :-D

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

oh Garvin, you are so innocent :D, some users really do this. What about a simple check to see if the title is empty (like when a category isn't used) and then a little javascript that stops you saving the entry until you have one?

Carl
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Actually, that's what the plugin is for. I wouldn't want to force users into having non-empty titles, because some people might need to tweak their own titles to use non-empty titles, and the s9y core shouldn't disallow it.

Well, actually it's really all about the recent entries plugin, where I did insert the entry ID which helps for that rare cases?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

yeah your fix does solve the problem, if you consider it a problem.

Thanks,

Carl
Post Reply