i created a view with a slide show (for page and default display).
i don't see the slide show in the preview (view edit).
if i create a page and visit the url with the browser i see the slide show.
if i embed a view in a page with views_embed_view() i don't see the slide show.
is this a normal behavior or can i do something about it?
cheers.
Comments
Comment #1
dragonwize commentedThe slideshow will never work in the preview. This is because of how views does previews not any fault of this module. Views just pulls the data it doesn't do full theming which would include the needed javascript.
The views embed doesn't currently work but hopefully will be fixed in a future release.
Comment #2
e_log commentedthanks for the clarification!
Comment #3
sebos69 commentedHi,
I just tried the Views Slideshow module (-dev version), within an views_embed_view(), and the slideshow actually displays and refreshes itself, but below the slideshow, I get extra-caracters like:
Comment #4
redndahead commentedHmm seems like a tag isn't closed. I know it's been a long time has this been fixed sebos69?
Comment #5
redndahead commentedMarking as fixed. Feel free to reopen if you still have problems.
Comment #6
jboeger commentedCan we re-open this please? I am having the same problem:
Comment #7
redndahead commentedI'm assuming your problem is with view_embed_view. If that's the case can you see if the js files get loaded on that page.
Comment #8
redndahead commentedClosing from lack or response.
Comment #9
burlinwall commentedI am having the same problem. No js gets loaded when using views_embed_view. If i hard code the necessary js, it works, obviously.
Comment #10
burlinwall commentedThis was marked as fixed, but is it really? still doesn't work.
Comment #11
jfox77 commentedI am also having this problem:
Using views_embed_view() in my page.tpl.php file to display a view that has a style of "Slideshow" does not work. The first image appears but they never rotate.
I added these lines to the top of my page.tpl.php but that didn't help.
If I use the views_embed_view call in the body of one of my pages it works. But not when I put it in my page.tpl.php file. What else do I need to add to page.tpl.php so that it executes the same way it does as when it's in the body of a drupal page?
Thanks!!
Comment #12
burlinwall commentedYou have added the necessary files but your are missing the settings. For example, the code below is what loads in to my page in addition to the files you mentioned (when not using the embed function). If i hard code this into my page template, it works, but that's certainly not the way to go.
Comment #13
jfox77 commentedI added that section of code and now it's acting like it's trying to work, but it is just alternating between my first image and then no image. My second image is never appearing. What else am I missing?
Thanks!
Comment #14
jfox77 commentedOk, so after spending quite a bit of time on this, here's what finally worked for me:
1. put this in a block:
2. Assign the block to a region (i.e. header_last)
3. put this in my page.tpl.php
4. In my views settings:
Style = Slideshow
Items to display = 12 (I have 12 images)
Filters = filter by content type since I have a specific content type of "Courthouses" that allows an image to be attached.
Filters = add filter to make sure the content type actually has an image attached
Comment #15
burlinwall commentedjfox77, you can´t use my code. that is specific for when i generated my view. it was just an example.
Comment #16
jstollerIf views_embed_view() isn't going to work, than can someone please recomend an alternative method?I was hoping to have a function I could asign to a variable in template.php, and print in page.tpl.php to display the view slideshow.
Comment #17
titouilleMy two cents :
I have a slideshow block view to add on all pages of my site, in the footer.
in template.php, outside any function :
(code from module...)
I have two functions to retrieve the jQuery.extend() content, parse it and add a new slideshow element to get my block working :
(yes, not really optimized code...)
Finally, in my [theme]_preprocess_page method, I just add the following lines :
[edit]
Don't forget to call your new variable (called $sitesblock in my case) in the page.tpl.php, like
print $sitesblock;[/edit]
And it works. Now the must would be to retrieve all settings of my block (timeout, effect, speed, etc...) and put it in the new array created in my override_jQueryExtend_script method but I don't know if it's possible.
I must search how to know the number of pictures stored in the block to pass it as "num_divs" setting. But it's a good start to get the slideshow working with views_embed_view method.
Any suggestion are welcome ;-)
Comment #18
psynaptic commentedI committed a fix for this a couple days ago. Please test.
The View preview still doesn't work because views doesn't seem to fire template_preprocess_views_slideshow_[mode] which has the following code required for the slideshow to function:
Not sure what to do about this. Does anyone have any ideas?
Comment #19
redndahead commentedmarking as critical to look at before release.
Comment #20
redndahead commentedI'm marking as fixed. If people would like to see preview working please open a new issue.
Comment #21
dlx commentedHi redndahead,
I think whether preview is working or not really a non-issue here. The problem is that when views_embed_view() is called somewhere (not in the preview), the slideshow is not working.
Sincerely,
Alex
Comment #22
psynaptic commentedAre you trying with the latest dev?
Comment #23
redndahead commentedComment #24
aaron.r.carlton commentedI am also experiencing this issue. When I try to put the slideshow view in my page.tpl.php by calling views_embed_view(), the first frame renders but the slideshow does not initialize. I originally built my view using the 6.x-2.0 version but then replaced that with the 6.x-2.x-dev version and it still doesn't work. I am not at all concerned with whether the Views' preview functionality is working, this is broken when I try to render the view on the frontend.
Please elaborate on exactly which additional information you need to move this issue from postponed to the active list. I'll do my best to explain my scenario.
Comment #25
redndahead commentedAnyone have a website to look at?
Comment #26
Lloyd commentedDevelopment site. I've included the embed code only within the content and it's not coming up.
http://205.186.128.246/life-insurance-brokerage
Comment #27
redndahead commentedIf you don't use slideshow style and use unformatted style does it show up?
Comment #28
Lloyd commentedYes it does. There are about 30 different nodes included in the view and using the unformatted style they all display (one per row). And when using the slideshow style, I used all of the default settings.
Comment #29
Lloyd commentedOk that's odd. After I changed it from slideshow to unformatted, and then back to slideshow (without making any changes to settings), the slideshow is now displaying correctly.
Comment #30
redijedi commentedI am also experiencing this issue. Both with 6.x-2.0 and -dev. I get the following javascript error:
Error: Drupal.settings.viewsSlideshowSingleFrame is undefined
Source File: http://localhost/sites/all/modules/views_slideshow/contrib/views_slidesh...
Line: 14
It works fine when using a block. But embedding the view does not work.
Comment #31
aaron.r.carlton commentedMyself and a co-worker have been tracking this down. From what we can see, psynaptic's comment in #12 is closest to the issue. The problem is that drupal_add_js() is called deep inside the slideshow module in function template_preprocess_views_slideshow_singleframe().
Since I am trying to call views_embed_view() inside my theme's preprocess_page() function, the $scripts array has already been built, and the drupal_add_js() call to insert the slideshow settings onto the page never gets processed into $vars['scripts']. A workaround is to do something like this:
rebuilding the $scripts variable processes the settings code back onto the page. While this should work in the meantime, I think the module should make sure its javascript gets onto the page in any situation. I've toyed around with the module, but can't figure out a really good strategy to do this. If anyone has suggestions, I will try to implement them and submit a patch.
Comment #32
Lloyd commentedI'm once again having problems. Things were working fine. I did an update to the css file, refreshed the page and now the block does not advance past the first image. In fact, I have another views slideshow block on this page (placed on the page using the traditional block functions) and that doesn't work either. If I remove the embedded block, the other one works. Put the embedded block back in, neither works.
And also, just like before I went back into Views and made a change, saved it, and the slideshow is now back to working.
Comment #33
redndahead commentedComment #34
redndahead commentedTry using the latest dev. There are some rendering fixes that may help.
Comment #35
redndahead commentedI think aaron.r.carlton has the correct solution. You need to add the embed into the preprocess function and reload the javascript. It's going to be a hazard of embedding the view. Any other action I take to try and make it work will require me to load it on every page not something I want. So let me recap on what to do.
In template.php have.
In the tpl.php file where you are embedding the view put.
Sorry that there isn't a better solution.
Comment #37
viil commentedsubscribing in case this will be looked into...
Comment #38
nravens commentedThe solution mentioned in #35 worked for me but only in firefox... it doesn't seem to work in IE6... anyone know why that could be??
Comment #39
nravens commentedok, I had a dumbass moment.. it's working. I forgot to enable the permissions for the content field. I was logged in as admin on firefox but not logged in on IE...
Comment #40
redndahead commentedThis should have stayed fixed.
Comment #41
mattwmc commentedI'm having difficulty embeding in front page using advanced front page settings mod.
I guess I need to hardcode the javascript? Like in #11 and #12?
Comment #42
opensense commentedComment #43
jameswoods commentedExcellent! Thank you. I had a similar problem, but with a view that required some css too (jcarousel). I added
and my problems were solved. Thanks for posting!!
-James
Comment #44
parasolx commentedseriously, comment #35 solved my problem also.
i think it should be nominate in documentation since there is no problem regarding the code. when comes to complex modification, it need to do some adjustment.
thank you.
Comment #45
redndahead commentedIt is documented in our documentation section.
Comment #46
sammyframson commented#35 worked perfectly for me as well after much time and frustration. I did have a few bonehead moments however... I neglected to change my specific view name...e.g. in my case from "page_image_rotator" to "rotating_banner" - a couple important areas to make the change.
Thanks for the great module and the solution!
Comment #47
yngens commentedAnother of doing this without adding additional code into template.php is to create a region and place views block in the region.
Comment #48
yan commented#35 did the trick for me, thanks!