Posted by Bevan on October 6, 2011 at 9:58pm
3 followers
Jump to:
| Project: | Galleria |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
The commercial theme for Galleria "twelve" extends Galleria core with more options.
This patch adds support for these options.
| Attachment | Size |
|---|---|
| support_twelves_options.patch | 1.24 KB |
Comments
#1
Since every custom theme might add some new options, this possibly needs a plugin hook...
It's already confusing to set options while you don't know if a theme supports this or not...
Any suggestion about extensibility?
#2
I think we should support the extended options for the "official" themes out of the box, but they should only be visible when the belonging theme is installed.
So thanks for your patch, Bevan. I'll have a look at the other theme's options asap.
@miro_dietiker: The problem with a plugin hook is: Do you really want to install and enable a new module for every custom theme just to have support for the theme-specific options?
#3
I think a "custom option" option would be useful for custom themes and more obscure public themes.
I agree that these options should only be exposed by themes that support them.
I wonder if there is a way to parse the theme's JS from PHP and work out what the options are. Perhaps if the library can be instantiated client-side in a hidden iframe or div and the keys of
galleria.optionscan be sent back to the server via AJAX?#4
Since users are generally free in implementing a plugin and what it supports, the code might be diffrent from case to case.
We'll need to define a way in how to define the option.
We better define some additional file format (e.g. containing some JSON data).
#5
@Bevan: Well, there IS a "custom option". Just type in any option name you want instead of selecting one from the drop-down list! You get a text input for each unknown option. If you need boolean values, enter "true" or "false", they will be converted accordingly.
#6
If you are going to require that each theme have an "option definition list" defined in code, that will always be specific to Drupal, so you might as well do it in PHP in the module, or in custom modules via
hook_galleria_options()orCUSTOM.galleria.inc.However you can retrieve the list of options from the javascript file by letting the admin's browser parse the file for you, as I alluded to in comment #3. It's tricky, but manageable. The possible options get stored in the database.
galleria/get-optionsandgalleria/set-optionsmaintenance-page.tpl.php)Drupal.settings(or equivalent) with the list of hard-coded options. i.e.array_keys(galleria_option_elements())_optionsproperty from the Galleria object_options.galleria/set-options.galleria/set-options, save the options and their types (e.g. Boolean, Integer, String) to the database.So there is. I had not noticed the feature. I think it could be made more notice-able in the UI.
#7
The problem with the dynamic loading idea is that we would just have more option names in the select box, but noone would know what they are for, because we don't get any description or documentation for them.
So I think the only manageable way is to add them manually to the list, maybe depending on which theme is selected.
Well... how? Currently, there is the "Select or enter:" text next to the "Add option" button, and it is selected by default! You have to manually select an option for the input field to vanish...