Page 1 of 7
static page plugin
Posted: Tue Oct 12, 2004 9:35 pm
by romulus
I have written a static page plugin which you can download from my site:
http://www.romulus23.de/uploads/romulus ... ge-0.3.zip
What does it do?
I'm still wondering why so many blogs only know "articles" with a fixed date which can be posted. This article gets older and older, maybe isn't displayed on the front page anymore, gets spammed and finally forgotten. But I always wanted to have some part of my blog/site that is static, most often used for a "about me" page, but not limited to that. And this page should be displayed in my blog design with normal formatting I have in all my other articles.
And basically, this is what this plugin does. I'm already using this plugin on my
site (look into link "über mich" in upper right corner). You can add as many static pages as you want if you add this plugin in the desired number.
Who to thank?
Garvin. He has written almost all of this plugin in this
post, though unkowingly

Re: static page plugin
Posted: Wed Oct 13, 2004 12:01 pm
by garvinhicking
Hi romulus!
It's fairly easy to apply formatting. You just need to rename
Code: Select all
$entry = array('staticpage' => $this->get_config('content'));
serendipity_plugin_api::hook_event('frontend_display', $entry);
echo $entry['staticpage'];
to
Code: Select all
$entry = array('body' => $this->get_config('content'));
serendipity_plugin_api::hook_event('frontend_display', $entry);
echo $entry['body'];
Because the markup plugins operate on the array key 'body' (or 'extended') to find, where the text is stored in...
Thanks for the contribution, I think several people will find it useful
Regards,
Garvin.
Posted: Wed Oct 13, 2004 2:45 pm
by romulus
thanks its working now
Additionally I have added an option to automatically output the text with article formatting (colors, background, borders, and so on).
Maybe you guys should think about to add something like this to 0.8 release, as I really think that coulde be useful for a lot of people.
Hint: to make a nicer URL for a static page you can add the following line to your .htaccess:
Code: Select all
RewriteRule ^pagetitle index.php?serendipity[subpage]=pagetitle
So instead to open this ugly URL
http://www.yourblog.com/index.php?seren ... =pagetitle you can now open this nice one:
http://www.yourblog.com/pagetitle
Posted: Wed Oct 13, 2004 2:48 pm
by garvinhicking
You could also spawn an external hook and then call:
http://www.yourblog.com/plugin/static_aboutme.html
Regards,
Garvin.
Posted: Wed Oct 13, 2004 5:35 pm
by romulus
you guys are crazy, do you know that? Is there something s9y can't do? Admit it, there exists some hidden admin area where s9y can cook a perfectly brewed coffee, right?

Posted: Wed Oct 13, 2004 5:49 pm
by garvinhicking
Well, when there's one thing I am most proud of, it's Serendipity's Plugin Architecture.

))
About the coffee-stuff - I don't do coffee, so I suppose someone else needs to implement that
Regards,
Garvin.
Posted: Sat Oct 16, 2004 5:07 pm
by Little Hamster
Nifty plugin!
PS. All the discussions in this thread was so serious that I feel like butting in

Posted: Sat Oct 16, 2004 6:23 pm
by romulus
no problem
I have just released version 0.3 (look into first post) and made an englisch info page in my blog:
http://www.romulus23.de/s9y-plugins/staticpage-en
Posted: Mon Dec 06, 2004 3:30 am
by davecjr
I was using the static page plugin in version 7 and upgraded s9y to 8 alpha 4 and now the static page shows up at the bottom of the main blog body page. Are there any easy fixes or anyone else using this having the same problem?
Thanks
Posted: Mon Dec 06, 2004 2:06 pm
by garvinhicking
Sadly you need to upgrade that plugin. Please look here:
http://cvs.sourceforge.net/viewcvs.py/p ... l_plugins/ for the latest version!
Regards,
Garvin
Posted: Mon Dec 20, 2004 5:20 pm
by Rembrandt
Hi!
I'm using s9y from the cvs branch and the static page plugin (also from cvs). The plugin works fine, but I want to use "fency" URIs like "
http://www.mydomain.tld/static/[i]pagetitle[/i]. I followed the instructions from the plugin creator's homepage to rewrite the URI but at the bottom of the page, s9y places an error-message that the requested document doesn't exist.
TIA,
Rembrandt
Posted: Mon Dec 20, 2004 6:07 pm
by garvinhicking
The fancy URLs will only work when using mod_rewrite - do you use that?
Regards,
Garvin
Posted: Mon Dec 20, 2004 6:30 pm
by Guest
Yes, I do.
And I put the following line in the .htaccess:
Code: Select all
RewriteRule ^static/(.*) /index.php?serendipity[subpage]=$1
The correct page is displayed - but with an error-msg from s9y.
so long...
Rembrandt
PS: You can see the error-msg at the bottom of plugin creator's homepage (
http://www.romulus23.de/s9y-plugins/staticpage-en)

Posted: Mon Dec 20, 2004 6:47 pm
by garvinhicking
Ah, okay - I see. I have fixed this issue in CVS, the error is not really usefull there.
Regards,
Garvin.
Posted: Mon Dec 20, 2004 6:50 pm
by Rembrandt
garvinhicking wrote:Ah, okay - I see. I have fixed this issue in CVS, the error is not really usefull there.
Regards,
Garvin.
I've tried to find the error and looked in several files. Where was the error?