entry_properties not available without plugin?

Discussion corner for Developers of Serendipity.
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

entry_properties not available without plugin?

Post by Don Chambers »

This might be hard to explain without providing an actual template, but I will try... :wink:

I'm working on a new theme that has template-specific entry properties. These properties can typically be emitted as {$entry.properties.my_property}.

So, I have a custom entries.tpl. With the extended properties for entries plugin, my entry property prints in any $view, ie detailed entry view, startpage, etc.. However, without the plugin installed, the $entries array does not contain any extended properties for any view other than a detailed entry view. I have not tried this in anything other than s9y 2.0.

I was under the impression that using theme specific entry properties did not require the extended properties plugin. Is this not true?

I can test suggestions, but the theme isn't far enough along to share just yet.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: entry_properties not available without plugin?

Post by yellowled »

Don Chambers wrote:I was under the impression that using theme specific entry properties did not require the extended properties plugin. Is this not true?
I would assume (although I have never tried it) that without the plugin installed, the theme does not have any extended properties because that's what the plugin adds to entries (among other things) …?

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: entry_properties not available without plugin?

Post by Don Chambers »

Those properties are available when viewing a detailed entry, but nowhere else.

The whole concept of theme properties was Introduced by Garvin several years ago. I believe it is supposed to work without the need for using the extended properties plugin.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: entry_properties not available without plugin?

Post by garvinhicking »

Hey,

the plugin indeed is required to parse and properly offer entryproperties to an entry, yes. The core only fetches it on a s pecific place where it would have cost too much performance to handle it in a plugin, that's why some properties get read in a single entry. But for multiple entries, the plugin takes care of fetching and parsing that data.

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/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: entry_properties not available without plugin?

Post by Don Chambers »

Thanks for the clarification Garvin. So, no chance of retrieving entry properties without the plugin for theme-specific properties? Extended Properties plugin has numerous other features. I thought the idea for theme properties was less overhead if you only needed a field or two, rather than use the whole plugin.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: entry_properties not available without plugin?

Post by garvinhicking »

Hi!

Yeah, not really. Fetching entryproperties is one of the things that dearly cost performance and thus need to be disable-able. If it's already in a plugin, creating a core-functionality and having a config option to remove that functionality is really more of a brainfart. Your template can emit a message ilke "Needs the entryproperties plugin to work", and you can check with PHP/Smarty-Code if that plugin exists...

However, with the documentation you mentioned, the template is more or less rebuilding the entryproperties plugin, so it "only" would need more API hooks to perform fetching the properties in the overview. However that is so much overhead that it's not really recommendable, and the entryproperties plugin should be used for that...

HTH,
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/
Post Reply