| View previous topic :: View next topic |
| Author |
Message |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
Posted: Thu 26 Jun, 2008 17:10 Post subject: plugin preferences limit... |
|
|
I found a ugly limit in the plugin preferences:
I started to implement a simple file/picture gallery plugin. For these types of plugins it's boring that there exist only one preferences "group"...
A user can only have _one_ gallerie for his page.
If we have somethings like "multiple" preferences, a user can create more than one galleries with different settings.
I think it's only a small step to implement this. We must break up the plugin table and split the preferences via foreign key.
The existing Preferences Form in the plugin config file is only for the default values. These values copied into a new instance.
e.g.:
1. The Admin changed some values in the default Gallery preferences.
2. The Admin created a new gallary named "FirstGallery". He can insert the gallery with: {% lucidTag gallery name="FirstGallery" %}
3. PyLucid create a new, individual Preferences entry for this FirstGallery and used all values from the default Gallery preferences.
4. Creating a new Gallery e.g. "SecondGallery" created a new preferences entry from the default preferences, too.
5. The Admin can now inserted {% lucidTag gallery name="SecondGallery" %} somewhere. He can setup both existing galleries completely different.
For some plugins there makes no sense to create different instance. e.g. back_links, admin_menu, find_and_replace, system_settings
The preferences API can de something like this:
| Code: | # For plugins who only have one preferences:
preferences = self.get_preferences() |
| Code: | def lucidTag(self, name):
# For plugins with more preferences:
preferences = self.get_preferences(name) |
Any comments? _________________
http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|