The problem was web2py was not serving files ending in .html to the
browser. All I needed to do to get shadowbox running with web2py was
create a routes.py that added .html to all web2py URLs.

Here is the routes.py file contents that fixed the problem. My
routes.py file now creates a URL followed by .html, which is needed
for the whole thing to work with the shadowbox library (and any other
javascript library).

On OSX:
web2py/Contents/Resources/routes.py
routes_in=(
           ('/$c/$f.html','/tripplanet/$c/$f'),
           ('/$c/$f','/tripplanet/$c/$f'),
           )

routes_out=(
            ('/tripplanet/$c/$f','/$c/$f.html'),
            )


Thats it. Now any time you put URL(r=request, f='function'). The
resulting url is yoursite/controller/function.html.  Note that the url
no longer includes the app name.
i.e. yoursite/appname/controller/function.html.

Also, if you type in that address it keeps it in the address bar
without transforming it to the same without the .html.

Lastly, the app can be still reached by typing the info without
the .html. i.e. yoursite/controller/function (no .html).


THIS NEEDS TO GO ON THE WIKI AS A TUTORIAL ON HOW TO GET SHADOWBOX
RUNNGIN WITH WEB2PY!











On Apr 7, 10:49 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I think your problem is the +".html" below
>
> {{=URL(r=request, c='mycontroller',f='myfunction')}}.html
>
> It should not be there.
>
> On Apr 7, 12:30 pm, waTR <roman.goldm...@gmail.com> wrote:
>
> > I noticed that if I enter an href="{{=URL(r=request, c='mycontroller',
> > f='myfunction')}}.html", the embedded window pops-up, however, it is
> > blank because if I manually enter that address, I get invalid
> > function. I wonder if simply setting up a rout that will re-direct the
> > above to just URL(r=request, c='mycontroller', f='myfunction') would
> > work?
>
> > I am trying this out, however, the manual is unclear as to how to get
> > routes working. It says to put a routes.py file in the web2py
> > folder...the root application folder? I did that and I still can't
> > access the new rout of URL(r=request, c='mycontroller',
> > f='myfunction') + .html in the address bar...
>
> > On Apr 7, 10:09 am, waTR <roman.goldm...@gmail.com> wrote:
>
> > > I could be wrong though, so if someone can get shadowbox javascript
> > > library to work with web2py, especially the iframe embedded windows,
> > > that would be awesome.http://www.mjijackson.com/shadowbox/index.html
>
> > > I have the embedded window working. I.e. I can give it an href 
> > > ofwww.google.com, and an embedded window will pop-up with that webpage
> > > showing in an iframe in the embedded window. However, if I replace the
> > > url with a web2py url, it just forwards the browser to that page.
>
> > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to