Hi and Good morning!
I'm porting a new WP-Theme (magazeen) to s9y and I need some features wich I don't know how to realize.
I need to fetch the last 3 entries of the same category from an entry inside entries.tpl. The result should be (watch the demo) a dropdown with the latest entries of the same category. Is that possible?
Thaks for any help!
Greetings, Lordcoffee
Fetching Entry titles from category
-
lordcoffee
- Regular
- Posts: 308
- Joined: Tue Nov 29, 2005 10:22 pm
- Location: Munich - Germany
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Fetching Entry titles from category
Hi!
Yeah, that's possible by accessing the Smarty API, use the {serendipity_fetchPrintEntries} smarty function (see s9y.org for documentation) and specify the category parameter. I believe other magazine template like Mimbo also make use of this, so you could have a look?
Regards,
Garvin
Yeah, that's possible by accessing the Smarty API, use the {serendipity_fetchPrintEntries} smarty function (see s9y.org for documentation) and specify the category parameter. I believe other magazine template like Mimbo also make use of this, so you could have a look?
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/
# 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/
-
lordcoffee
- Regular
- Posts: 308
- Joined: Tue Nov 29, 2005 10:22 pm
- Location: Munich - Germany
- Contact:
Re: Fetching Entry titles from category
Thanks!
One small problem left. I'm using this code:
I want to fetch the category id automatic with this:
But when I just insert it, it results in an empty page:
I know that I've made something wrong but I can't figure out how to handl this.
Thanks in advance,
lordcoffee
EDIT:
Sorry, found the problem. Now I'm using:
and it works like a charm 
One small problem left. I'm using this code:
Code: Select all
{serendipity_fetchPrintEntries category="2" full=false fetchDrafts=false noSticky=true limit="0,3" template="entries_titles.tpl"}Code: Select all
{$entry_category.categoryid}Code: Select all
{serendipity_fetchPrintEntries category="{$entry_category.categoryid}" full=false fetchDrafts=false noSticky=true limit="0,3" template="entries_titles.tpl"}Thanks in advance,
lordcoffee
EDIT:
Sorry, found the problem. Now I'm using:
Code: Select all
{serendipity_fetchPrintEntries category=$entry_category.categoryid full=false fetchDrafts=false noSticky=true limit="0,3" template="entries_titles.tpl"}