ScriptyLightbox fails in EE2.x ? How to use ScriptyLightbox2?

In my original build of a site using EE1.X I used the ScriptyLightbox Action to call a page with changing content. (that page has PHP Make Insert Page action) Worked swell, I was very happy.

Now I rebuild the site to EE2.X, and this does not work anymore. Code is EXACTLY same.


<a href="{entry_id_path="editors/preview"}" class="lightwindow"><img src="{site_url}/images/uploads/preview.gif" border="0" width="58" height="15" alt="" style="vertical-align:baseline"/></a>  {title}

It seems to me that the page searches for something, because the browser does not react anymore on input (like calling a new tab by using CMD-T, very very strange. This happens AFTER I click ONCE on the link. Clicking inside page does not help.

When I add class=“lightwindow” to my link, this happens. Without, the link just calls the page in a browser window, obvious.

Anyway, I tried ScriptyLightbox2, but that one cannot call a page, is that right?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On Feb 28, 2011, at 1:56 AM, atelier wrote:

In my original build of a site using EE1.X I used the
ScriptyLightbox Action to call a page with changing content. (that
page has PHP Make Insert Page action) Worked swell, I was very happy.

Now I rebuild the site to EE2.X, and this does not work anymore.
Code is EXACTLY same.

It seems to me that the page searches for something, because the
browser does not react anymore on input (like calling a new tab by
using CMD-T, very very strange. This happens AFTER I click ONCE on
the link. Clicking inside page does not help.

When I add class=“lightwindow” to my link, this happens. Without,
the link just calls the page in a browser window, obvious.

Could you post a link, or barring that, try running your test in
Firefox with the Firebug extension on and running in its Console tab?
It sounds as though it’s trying to load the page, and not getting
anywhere with your server. If you don’t see anything on the Console
tab, then click on the little disclosure triangle on the Console tab,
and make sure that “Show XMLHttpRequests” is checked on.

Hosting could also be an issue, particularly if your EE2 application
uses browser sessions to manage user interaction. When building the
Ajax components of the FreewayTalk web view, I discovered that the
HaveHost server it was hosted on was only allowing one thread per
session, and I had to go through the entire application, manually
calling session_write_close() at the end of each action in PHP to get
things to work correctly. The LightWindow code creates a second
request to your server from within the current user’s context,
essentially piggy-backing on any existing session.

Anyway, I tried ScriptyLightbox2, but that one cannot call a page,
is that right?

Yes. Only photos and movies can be loaded into the new one. I’ll find
some time to work on adding page fragments some day, but not anytime
soon.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Cant’t send you a link, it’s a local build with MAMP.

But I’ll check with FF, see what happens.

If necessary, I could also build the lightwindow by hand. I think all the files are here: LightWindow Demo

I’ll be back here to report.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

The console shows this:

reference to undefined property this[arguments[0]]

XPCSaf…per.cpp (regel 450)

These lines repeat some time, then:

uncaught exception: Page Type could not be determined, please amend this lightwindow URL http://localhost:8888/testsite/index.php/editors/preview/11

Hopefully you know what this might mean.

regards

Hans


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Oh, that makes total sense to me. LightWindow uses the filename extension to determine how to deal with content. Since your pages have no extension (actually the extension is mired midway theough the URL) it can’t figure things out.

Does ee2 support mod_rewrite for “friendly” urls? If you can get rid of that index.php from the middle of the URL, and maybe bang a .html on the end, you should be able to work around this.

If you can’t do that, then see if you can send it query string urls like ?controller=foo&action=bar&id=42 – those will definitely work just fine.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Yes, I could get rid of the index.php, but that’s a bridge too far for me, need to have access to a .htacess file, host does not allow that.
The HTML is added later by EE, so adding this to the link would cause an error.

I’m interested in that second part of your comment.

I’m not yet familiair with expressions foo and bar (I’ve seen them a lot amoung coders though)

My raw code for the URL (that calls the page with the dynamic content) is as this:

<a href="{entry_id_path="editors/preview"}" class="lightwindow"><img src="{site_url}/images/uploads/preview.gif" border="0" width="58" height="15" alt="" style="vertical-align:baseline"/></a>  {title}

How would you rewrite that one, using the scriptylightbox action?

Thanks!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In the meantime, I got it working by building it by hand, using the iFrame version of this: Colorbox - a jQuery lightbox

But I’, certainly also interested in your comment, tu use the Freeway methode some time later…

Thanks, as always…

regards

Hans


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What does entry_id_path expand out to in generated HTML? Is that what gives you index.php/editors/preview/11?

Does EE2 allow you to construct querystring URLs? I know CodeIgniter (on which it is based) does, but it’s a preference setting you have to make in your configuration. I don’t know if they expose that to you. It might be a good thing to ask the EE community.

The bit with the foo/bar etc. was an off-hand way to refer to a querystring URL. If this was CodeIgniter, then the querystring URL for your page would be index.php?c=editors&m=preview&id=11. Here’s a page with more info about this: http://expressionengine.com/user_guide/general/urls.html Read down toward the bottom about forcing query strings. I am pretty sure that getting the ? in there would actually work for LightWindow. The only other thing is would this mess up the rest of your application? You have it on MAMP, so easy enough to try it out. This is a PHP preference in EE, not an htaccess setting, so you don’t have to worry about your host. (By the way, what host doesn’t let you have .htaccess?)

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 1 Mar 2011, 3:08 am, waltd wrote:

What does entry_id_path expand out to in generated HTML? Is that what gives you index.php/editors/preview/11?

Yes

Does EE2 allow you to construct querystring URLs?

I shall ask, a quick search did not return any clues.

… the querystring URL for your page would be index.php?c=editors&m=preview&id=11.

I understand. Point is that I cannot hard-code the entry_id in my links. Here I use the tag entry_id_path because that generates the URL with the unique database ID for that item.
So maybe this could work: index.php?c=editors&m=preview&id={entry_id} I’ll try it out.

(By the way, what host doesn’t let you have .htaccess?)

Ehm, my own, to mention one… And this host also. I asked often, it’s a security thing. One could mess up the whole server with a badly written file, they say.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry Walter, it does not work.
The code


<a href="index.php?c=editors&m=preview&id={entry_id}" class="lightwindow">

gives as URL:


http://localhost:8888/testsite/edit/default_site/level/index.php?c=editors&m=preview&id=10

Very strange that Scriptylightbox did dot cause any problem in EE1 .

Anyway, I got my lightwindow working by using Colorbox Colorbox - a jQuery lightbox ‘handcoded’ in my template, so for me it’s OK to stop here.

Thank you.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options