I made a simple staticpage-plugin. It is probably indeed too simple to exchange the original with it. It needs testing, especially with mod_rewrite. And so far, it has no styling apart from some classnames and ids. Will only work with smarty 3, so it needs s9y 1.7.
But: Fully smartified, easy workflow, no clutter, easy to enhance (270 loc).
simple staticpage plugin
simple staticpage plugin
- Attachments
-
- serendipity_event_simple_staticpage.tar.gz
- (3.8 KiB) Downloaded 435 times
Re: simple staticpage plugin
Hi, I just read your blog post and I will try to test it, but not in the next couple of days, sorry. Maybe we can talk about during the dev sprint.
Re: simple staticpage plugin
All I'm about to write may sound stupid, be technically not feasible and/or is by no means meant as criticism towards the simple static page plugin (which I haven't tested yet). Bear with me.
Can't we just “re-use” functionality which is currently used for entries to create static pages? I mean, basically a static page is not that different from an entry. A static page is supposed to have a title and an url created from the title. It also has a publishing date, content (entry) and pre-content (extended entry). We could even use the category functionality to assign categories with static pages. Obviously, static pages don't need most of the features provided for entries by plugins like tags, extended properties etc., but the only actual difference (as far as I can see right now) is the fact that static pages are not ”presented” in a chronological order.
Does that make any sense at all?
YL
Can't we just “re-use” functionality which is currently used for entries to create static pages? I mean, basically a static page is not that different from an entry. A static page is supposed to have a title and an url created from the title. It also has a publishing date, content (entry) and pre-content (extended entry). We could even use the category functionality to assign categories with static pages. Obviously, static pages don't need most of the features provided for entries by plugins like tags, extended properties etc., but the only actual difference (as far as I can see right now) is the fact that static pages are not ”presented” in a chronological order.
Does that make any sense at all?
YL
Re: simple staticpage plugin
That makes sense, I thought about it.
The difference between static pages and entries I saw is exactly that some things are not needed, especially that the page is not in a context sorted by date. The URL shall look like a stable URL and can be/should be easy to add to the template-navigation. And the not-needed things are which make it easy to write such a plugin, I for example removed the pre-content on purpose (which function does it serve on a static page? None at all, as far as i can see).
We could probably save a staticpage as an entry with a specific publish-status or something else which hides it when fetching normal entries. But given the plugin-code to talk to the database is really not long (4 short functions), i don't see that big an advantage in this.
The difference between static pages and entries I saw is exactly that some things are not needed, especially that the page is not in a context sorted by date. The URL shall look like a stable URL and can be/should be easy to add to the template-navigation. And the not-needed things are which make it easy to write such a plugin, I for example removed the pre-content on purpose (which function does it serve on a static page? None at all, as far as i can see).
We could probably save a staticpage as an entry with a specific publish-status or something else which hides it when fetching normal entries. But given the plugin-code to talk to the database is really not long (4 short functions), i don't see that big an advantage in this.
Re: simple staticpage plugin
Sure, but it's still supposed to have a date (as “last edited”).onli wrote:The difference between static pages and entries I saw is exactly that some things are not needed, especially that the page is not in a context sorted by date.
I have no idea whether that would be an advantage, I just thought I'd mention it. Also, if it's not a plugin, it wouldn't need to be installed seperately. It sort of would be “in the core by default”.onli wrote:But given the plugin-code to talk to the database is really not long (4 short functions), i don't see that big an advantage in this.
YL
Re: simple staticpage plugin
A remark: I just got notified that my static pages where not working, showing my projects and such. And indeed: they didn't work. What happened was that they were set to be a draft. I never noticed.
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: simple staticpage plugin
Seems for a very long static pages were viewable by all regardless of draft/publish status. Many people, me included, had several static pages with a draft status. Some fix to the static page plugin not long ago corrected this behavior - draft static pages were no longer viewable until published, as they never should have been.
=Don=
Re: simple staticpage plugin
Which explains why I didn't notice when making those pages. That fix wasn't such a good idea -.-
Anyway, there is a lesson here for the simpler version of the plugin: Draft-state shouldn't exist in this form or be very noticeable.
Anyway, there is a lesson here for the simpler version of the plugin: Draft-state shouldn't exist in this form or be very noticeable.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: simple staticpage plugin
Drafts are IMO a very important feature so that you can hide pages. IMO this is not optional for a future plugin...
Regards,
Garvin
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/
Re: simple staticpage plugin
If that be so, that status should be very noticeable - specific styling on the page itself and an icon or specific placement on the backend.
But as the pages are listed nowhere in the frontend, which function fulfills that status?
But as the pages are listed nowhere in the frontend, which function fulfills that status?
Re: simple staticpage plugin
What does that mean? Did I miss something? Is there an agreement to drop the old staticpage plugin and write a new one?garvinhicking wrote:...not optional for a future plugin...
If someone heads there... I have to state that I would prefer to stick with the old and modernize it via a really simple template (something like the one Malte has in mind) and rename the current 'simple template' to more specific 'all field (structured)' template, or put the whole staticpage functionality into core.
Btw, I can't find any fixes of draft in last commit hist... or is the added $is_staticpage var meant?
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: simple staticpage plugin
But that's exactly the reason; people would need to be able to temporarily disable static pages if they need to work on it or if they are not yet finished.But as the pages are listed nowhere in the frontend, which function fulfills that status?
I agree, the status indicator could be much more visible.
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/
Re: simple staticpage plugin
Ok, temporary disabling, especially after the page was online before, is a very valid usecase. Will be included.