Page 1 of 1
Plug-in to put HTML Nugget on top of the page
Posted: Wed Jul 20, 2005 3:48 am
by wesley
Okay, I made this hack of a plug-in lets you put an HTML nugget on top
of a page (on the entry page for the moment, not main page, sorry). No
need to edit the .tpl file if you're gonna place a banner or nav bar on the
top, I guess. I'll need to put the option of having this work on the main
page as well later on.
Big thanks to Garvin Hicking. The code is largely based on HTML Nugget
plug-in and Links to Next/Previous Entry plug-in, actually. I have close to
ZERO experience on PHP.
The plug-in should appear on the SourceForce CVS web view in a couple
of hours. It's labeled 'serendipity_event_topnugget'.
You can see how it's working at my blog. Click on a blog entry to see the
ad banner on top of the page being shown by this plug-in.
Man, I hope it doesn't mess up other stuff.
Posted: Wed Jul 20, 2005 4:51 am
by gwilsonmail
Great idea for a plugin. I'm sure i'll be using it.
Now who's working on the bottom_nugget plugin?
Posted: Wed Jul 20, 2005 11:13 am
by garvinhicking
Before someone adds a "bottom_nugget" plugin, may I please propose this:
Combine the "topnugget", "headnugget" and "bottomnugget" plugins into one single plugin and change the propertiy back attribute 'stackable' to 'true'. So people can add more than one of those nuggets.
Then add a config select option to toggle where to display the nugget: "top", "bottom", "head". Depending on that option, the plugin emits the code at the appropriate hook.
How's that?
Regards,
Garvin
Posted: Wed Jul 20, 2005 5:29 pm
by wesley
I did it!
The plug-in is now renamed to 'HTML Nugget on Page' and is listed as
'serendipity_event_page_nugget'.
You have the choice of putting the HTML nugget inside the HEAD tag, on
top of the page, or on bottom of the page. It is stackable, so you can put
as many of them as you like. You can apply markup transformation if
you want, like the original HTML nugget plug-in. I have, however, disabled
markup transformation if you use HEAD tag option, because it's not needed
there. Also, like the original HTML nugget plug-in you can have the nugget
appear all the time, only show up in the extended entry, or only show up
in the overview page.
I think this plug-in would be quite useful now. Enjoy!
One thing, though... I wish there was a hook on the default template
that's placed right under the 'Posted by...' line which follows the article
main body. It might be a good place for an ad or even for the
event_entrypaging plug-in. Could it be done for the 0.9 version of s9y,
I wonder.
Posted: Wed Jul 20, 2005 5:36 pm
by gwilsonmail
sourceforge cvs is no longer used for s9y.
where can i get the plugin?
Posted: Wed Jul 20, 2005 5:52 pm
by wesley
Actually, BerliOS is used for the s9y's main trunk. SourceForge is still used
for the external plug-ins. Note how the Plug-ins page on s9y's main website
still points to SourceForge. BerliOS SVN does not have the external plug-ins
listed or updated. It seems to be used for the trunk development only at
this point. In fact Garvin himself updates his external plug-ins at SF. Hence
my plug-ins are also available at SF.
Wait about two hours for the SF's web CVS to update, then go
here.
event_topnugget is now deprecated so don't download that. Just wait for
event_page_nugget to appear.
Posted: Wed Jul 20, 2005 6:04 pm
by gwilsonmail
thanks.
the two cvs depositories wasn't obvious to me.
i followed the link and thought it was just an old link pointing to the old cvs.