stuck with serendipity_showPlugin

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
User avatar
costa
Regular
Posts: 110
Joined: Wed Feb 08, 2006 5:29 pm
Location: Poland
Contact:

stuck with serendipity_showPlugin

Post by costa » Fri Mar 03, 2006 3:33 pm

ok, i have some problems with smarty and using some serendipity's features like mentioned serendipity_showPlugin stuff.

the idea: i want to show a plugin in other place than sidebar. after reading some instructions on this page i found serendipity_showPlugin a tool to do that. but i'm stuck. after searching the forum for a little (i think carl had some problems with this method too) i did not find a clear solution for this problem. let's say i want to show the calendar and only the calendar plugin. as i understood i should give a class as a parameter. what is the class of calendar plugin? where i'll find a clear explanation of classes and detailed information of how to check if a plugin is installed? i know, those are the basics but i really stuck.

other problem: using serendipity_fetchPrintEntries method. it is a cool serendipitys feature but i can't make it work as i expect it to work. let's say i want to show the contetnt of the latest entry. so i'm doing something like that:

Code: Select all

{serendipity_fetchPrintEntries limit="0,1"}

and it works fine. but gives me also the footer and all other information (title and date). and i don't want that info, i want just pure entry, nothing more. so i tried something like that:

Code: Select all

{serendipity_fetchPrintEntries limit="0,1" use_hooks=0}

and no effect. ok, how i pass parameters into this method (or how you call serendipity_showPlugin stuff). i'm not a coder so please, talk to me like to a five years child, ok? ;)

you give me help = i give you a theme i'm currently working on. so, will we make a deal? :)
"everything is under control" - kasparov demo

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: stuck with serendipity_showPlugin

Post by garvinhicking » Sun Mar 05, 2006 9:13 pm

Hi Costa!

The showPlugin smarty function actually requires the PHP "classname" of a plugin. With external plugins that's very easy, since the classnames correspond with the directory names. So "serendipity_plugin_comments" for example is the class name to use with the Comments sidebar plugin.

The calendar plugin (and some few others) are harder to spot, for that I'm sorry. That is because those plugins are internal plugins, and their name are a bit different because of historical reasons. The calendar plugin's class is "serendipity_calendar_plugin". You can see that classname also is being used in the sidebar CSS classes, BTW.

About your fetchPrintEntries call: You basically were right, but the footers are actually not emitted using a plugin, but using template calls.

So what you want to do is this:

1. Create a "entries_single.tpl" file. Use the 'entries.tpl' file as a starting point for that. Remove all headers/footers/information you don't want to see there.

2. Use this Smarty call in your index.tpl or where you want it:

Code: Select all

{serendipity_fetchPrintEntries limit="0,1" use_hooks=0 template="entries_single.tpl"}


A simpler version of what you might want is this:

Code: Select all

{serendipity_fetchPrintEntries limit="0,1" use_hooks=0 use_footer=0}


The full documentation of all available code calls is in include/functions_smarty.inc.php before the serendipity_smarty_fetchPrintEntries funtion declaration.

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/

User avatar
costa
Regular
Posts: 110
Joined: Wed Feb 08, 2006 5:29 pm
Location: Poland
Contact:

Post by costa » Tue Mar 07, 2006 8:54 am

garvin, sometimes i just want to give you a biiig hug :)
that should solve the problem. big thanks! now only to find some time to play with the theme...
"everything is under control" - kasparov demo

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Tue Mar 07, 2006 12:51 pm

You're heartly welcome.

All of you people who make this forum be alive, who ask questions and who help the serendipity community with their questions and with the nice templates they produce are so a welcome, that I would like to handout big hugs everytime.

So have fun with that information above, I'm curious to what your results will show. :-)

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/

User avatar
costa
Regular
Posts: 110
Joined: Wed Feb 08, 2006 5:29 pm
Location: Poland
Contact:

Post by costa » Wed Mar 08, 2006 12:02 pm

OK, now i understood some things... everything works like a charm now. thanks again!

i'll be asking again garvin for some help with plugins properities. not now but i already see that something is somehow complicated for me too much. but first i'll try to solve problems by myself :). it's a hell good excersise!
"everything is under control" - kasparov demo

Post Reply