problem in Using highslide js in web2py ?

44 views
Skip to first unread message

Sampath Reddy

unread,
Nov 4, 2013, 3:05:01 AM11/4/13
to web...@googlegroups.com
Hi,

       I am trying to view my image gallery by using highslide js in my application.

       But I am not able to load/link graphics folder to hs.graphicsDir. As this is necessary for all the effects in viewing my image gallery.

       I am struck here. Could anyone please help me to fix this ?

      Your help is appreciated.


Thank you for your help.
 

Anthony

unread,
Nov 4, 2013, 8:31:04 AM11/4/13
to web...@googlegroups.com
From the highslide documentation, it looks like you could put the highslide files in /web2py/applications/yourapp/static/js/highslide/, and then in layout.html:

<script type="text/javascript" src="{{=URL('static', 'highslide/highslide.js')}}"></script>
<link rel="stylesheet" type="text/css" href="{{=URL('static', 'highslide/highslide.css')}}" />
<script type="text/javascript">
    hs
.graphicsDir = '{{=URL('static', 'highslide/graphics')}}';
</script>

Anthony

Sampath Reddy

unread,
Nov 4, 2013, 9:26:56 AM11/4/13
to web...@googlegroups.com, abas...@gmail.com
Thank you Anthony for your quick replay.

       But I already tried loading graphics folder by using URL option as you suggested.

       But it shows loading on image and the graphics options ( which are close button , next , previous buttons etc... which are in graphics folder ) are not loading.

       You can see the attached image file.

       Do we have to change anything in highslide.css/js so that intended graphics will lode ?

       But when I run these files simply in a simple html file without web2py the gallery is working properly as expected.

       Again Thank you for your time.

       Appreciate your help.
  


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/R_9mFZOQjbo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Screenshot from 2013-11-04 19:50:06.png

Anthony

unread,
Nov 4, 2013, 10:06:59 AM11/4/13
to web...@googlegroups.com, abas...@gmail.com
Maybe try adding the trailing "/" to the graphicsDir URL:

hs.graphicsDir = '{{=URL('static', 'highslide/graphics') + '/'}}';

Anthony

Sampath Reddy

unread,
Nov 5, 2013, 1:15:12 AM11/5/13
to web...@googlegroups.com, Anthony Bastardi
Thank you anthony for your help.

Now it is working as expected . Thank you :)

Why it is working when we add a trailing '/' as you suggested ? Is it because it is a folder we have to end with '/' ?



......
Sampath

Anthony

unread,
Nov 5, 2013, 1:18:43 AM11/5/13
to web...@googlegroups.com, Anthony Bastardi
It looks like graphicsDir is actually a partial URL, to which highslide will append the remaining URL paths for resources it needs. It is expecting the partial path to end in a "/". The web2py URL() function, however, does not add a trailing "/", so it must be appended manually.

Anthony
Reply all
Reply to author
Forward
0 new messages