Page 2 of 2

Re: Lightbox bug 2.4.0

Posted: Tue Mar 08, 2016 10:55 am
by Timbalu
Yeah, thanks. Now netmirror has synced and the package_event_XX.xml is up to date.

Re: Lightbox bug 2.4.0

Posted: Tue Mar 08, 2016 4:29 pm
by garvinhicking
Timbalu wrote:Yeah, thanks. Now netmirror has synced and the package_event_XX.xml is up to date.
Phew, great. Thanks for letting me know.

Regards,
Garvin

Re: Lightbox bug 2.4.0

Posted: Tue Mar 08, 2016 6:34 pm
by Don Chambers
Works now. May I suggest an upgrade? In addition to working for entry body, extended body, comments, and html nuggets, how about a setting that reads extended properties for the current theme and creates a similar yes/no for each extended property field??

Re: Lightbox bug 2.4.0

Posted: Tue Mar 08, 2016 7:14 pm
by Timbalu
Did you check this isn't working already included/merged to/with the body field?

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 5:36 am
by Don Chambers
Timbalu wrote:Did you check this isn't working already included/merged to/with the body field?
We can revisit this issue once the demo for my next theme is live, which is going to happen very soon. :wink:

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 9:50 am
by Timbalu
I asked this, since the plugin already checks these 4 markup elements: body, extended body, comments and nuggets. If you allow the default body to be checked, I don't really see a need to separate body and extended, while this is actually one entry! This is done by runtime. If delivered by single entry request and body is allowed, extended is parsed too. If not, we are on blog default page where only the body field is available.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 6:34 pm
by Don Chambers
Sorry - maybe my post wasn't clear

I understand the plugin can be configured to the entry body, extended body, comments and html nuggets.

My suggestion was to modify the plugin to also include an option to parse extended property fields (fields defined in serendipity_event_entryproperties) and theme specific property fields.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 6:55 pm
by Timbalu
"Ah.." :idea: - now I see... :wink:
Extended properties could be problematic though, since not known. Its a users decision what kind of extended propery field is used, isn't it? [...] You mean, read at plugin config workflow all available ep fields and make them configurable by dynamic option... for parsing? What kind of content could that be?

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 7:33 pm
by onli
Wouldn't that be very helpful for the photo theme (which would also be a good, already available testcase for that)?

I think I merged magnific popup into that theme for the article-images, but if the plugin could cover that, I could remove it.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 7:42 pm
by Don Chambers
Timbalu wrote:"Ah.." :idea: - now I see... :wink:
Extended properties could be problematic though, since not known. Its a users decision what kind of extended propery field is used, isn't it? [...] You mean, read at plugin config workflow all available ep fields and make them configurable by dynamic option... for parsing? What kind of content could that be?
Yes, extended properties can contain any kind of data... I personally use them A LOT for images. It might be a little more difficult than parsing entry body or extended body because there is no <a href=...> or <img> tag..... when using these ep fields for images, the value is typically just a path to an image in the media library.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 7:43 pm
by Don Chambers
onli wrote:Wouldn't that be very helpful for the photo theme (which would also be a good, already available testcase for that)?
Yes - definitely!

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 8:10 pm
by Timbalu
Ok please give me some example code to play around.
Then I can see if I get the idea to build that in....
If it is a simple path only ... why should it lightbox...?

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 8:20 pm
by Don Chambers
Timbalu wrote:Ok please give me some example code to play around.
Then I can see if I get the idea to build that in....
If it is a simple path only ... why should it lightbox...?
It may be a simple path, but what i am thinking of is a path to an image... something like "/mysite/uploads/image1.jpg.

A larger version of this image via lightbox might be nice.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 8:26 pm
by Don Chambers
The Kinetic theme used this bit of code (which probably isn't pretty) to detect available extended property fields defined in serendipity_event_entryproperties.... maybe it will help:

Code: Select all

if ($serendipity['GET']['adminModule'] == 'templates' || $serendipity['POST']['adminModule'] == 'templates') {
    $ep_msg = '';
    $ep_selections = array();
    $ep_plug = serendipity_plugin_api::enum_plugins('event', false, 'serendipity_event_entryproperties');
    if ($ep_plug) {
        $ep_id = $ep_plug[0]['name'];
        $plug =& serendipity_plugin_api::load_plugin($ep_id);
        if ($plug) {
            $fields = $plug->get_config('customfields');
                if ($fields) {
                    $ep_names = preg_split('/, */', $fields); 
                    $ep_selections['none'] = NONE;
                    foreach ($ep_names as $name) {
                        $key = 'ep_' . $name;
                        $ep_selections[$key] = $name;
                    }
                } else { 
                    $ep_msg = "<div class='serendipityAdminThemeMsgError'>" . EP_ERROR_NO_CUSTOM_FIELDS . EP_ERROR_REQUIRED_FIELDS . "</div>"; 
                }
        } else {
            $ep_msg = "<div class='serendipityAdminThemeMsgError'>" . EP_ERROR_INACTIVE_EP_PLUGIN . EP_ERROR_REQUIRED_FIELDS . "</div>";
        }
    } else {
        $ep_msg = "<div class='serendipityAdminThemeMsgError'>" . EP_ERROR_NONEXISTENT_EP_PLUGIN . EP_ERROR_REQUIRED_FIELDS . "</div>";
    } 
}
I am not sure the error conditions are correct, but it does correctly retrieve the custom fields defined by the plugin. I have not begun to consider how it might retrieve fields defined by a theme, but perhaps those are available in a similar way.

Re: Lightbox bug 2.4.0

Posted: Wed Mar 09, 2016 8:30 pm
by Timbalu
Don Chambers wrote:A larger version of this image via lightbox might be nice.
Yes, that is the normal usage for lightbox'ing. And even more some galleries...

But putting "/mysite/uploads/image1.jpg" into an EP field would need a case why this is necessary. At this point, I have no clue where this approach is heading to.., since a usage for some EP teaser image in a custom XX entries summary or something like this on startpage for example, is more like static, isn't it?