How to display a particular entry ?

Discussion corner for Developers of Serendipity.
Post Reply
pierre
Regular
Posts: 11
Joined: Thu Sep 22, 2005 2:10 am
Location: France
Contact:

How to display a particular entry ?

Post by pierre »

I want to display a particular entry , how do I do that ?
Thx for your job
jhermanns
Site Admin
Posts: 378
Joined: Tue Apr 01, 2003 11:28 pm
Location: Berlin, Germany
Contact:

Post by jhermanns »

write it.
Guest

How to display a particular entry ?

Post by Guest »

You seem very smart !

In fact it's not well documented how to get a special entry...
...and not so evident to write!
Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz »

could you please tell us what you wanna do? with a little more info?

do you want the url to show only one entry?
do you want to write something special?

I dont understand yet.
Marc
Guest

Get a special entry (id) in the template

Post by Guest »

I just want to get an entry in the template file. Besides calling the php function to get it, how should I do to get this entry by a template variable - like {$entry.id} ?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Get a special entry (id) in the template

Post by garvinhicking »

It seems you might want to use the "includeentry" ("Markup: Include entry data/templates/blocks") plugin.

Then you can add this in your entries:

Code: Select all

[s9y-include-entry:4711:body]
To show the body of entry #4711.

Hope I understood you properly.

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/
pierre
Regular
Posts: 11
Joined: Thu Sep 22, 2005 2:10 am
Location: France
Contact:

Getting Entry

Post by pierre »

Garvin,

Please look at http://info5765.infoweb-j.net

Do you see the title: 'info-une' at the top of page just beneath the toolbar?
ok...

What I need is print here a certain entry -that can change-

I thought I could do that in the 'entries.tpl' but I can't call php code (it doesn't print) so I dont know how to do it.
Thx for your job
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Getting Entry

Post by garvinhicking »

What you seem to be wanting to do is called "Sticky Entries". Install the entryproperties event plugin ("Extended properties for entries"), edit the entry that you want to show up at the top of your entrylist and look at the bottom of th page. There, check the button "Sticky Entry".

Best 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/
Guest

plugin entry ?

Post by Guest »

I don't find this plugin on the repository.

Can you send me the URL ?
thx
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: plugin entry ?

Post by garvinhicking »

The plugin serendipity_event_entryproperties is bundled with Serendipity > 0.8! So you already have it. There's no URL necessary.

It's exact name displayed in the plugin configuration installer is "Extended properties for entries". It's an event plugin. It might be called different in Non-English languages.

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/
Guest

Print an entry

Post by Guest »

Garvin,

Yes it works.
But not exactly as I wanted : the news at top should be replaced automatically by another that is checked asth new "top" one (à la une).

There is two news to edit to get this result now.

anyway it works
thx
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Print an entry

Post by garvinhicking »

Yes, that's right, that's how sticky entries work. You could use smarty code to discard any sticky entries after the first one by assigning variables and checking if those have been set, and then skipping one item of the foreach loop if the variable is set.

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