Closed (fixed)
Project:
Views Bootstrap
Version:
8.x-3.x-dev
Component:
Carousel
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 May 2016 at 14:07 UTC
Updated:
2 Oct 2016 at 13:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alzz commentedHere is a first attemp to port the carousel plugin to D8.
Im setting the carousel html id with the $view->dom_id, we have to figure out the best approach for ids for all the plugins.
Comment #3
kevla commentedPatch seems to work for me.
Getting a notice though:
Error messageNotice: Undefined index: default in Drupal\views\Plugin\views\PluginBase->setOptionDefaults() (line 182 of core/modules/views/src/Plugin/views/PluginBase.php).Comment #4
dobe commentedAll worked fine for me. I did change the way we get the id in this patch. It is more in line with D7 way of doing it. May not be the right way to get it done though.
Comment #5
dobe commentedComment #6
trevjs commentedI couldn't get it to work as is, but it seems to work after I made some changes.
In the theme.inc file the preprocess function is 'template_preprocess_views_bootstrap_carousel' but in your theme registry alter function you use 'template_preprocess_views_view_carousel'.
I also moved the theme path and include path out of the default case as those won't get included now that you added the breaks. Is the switch case even necessary?
Comment #7
trevjs commentedSee comments above.
Comment #8
dobe commentedYeah I agree. That whole switch statement in the views_bootstrap.module I think needs to go entirely (I was planning on making a separate issue for that. Then updating all the port issues to reflect that change. We could just use the code from the "default" in the switch which does exactly what needs to be done.
In addition to that. I found it difficult to override the twig file within my theme. Because we are coding the "path" in that switch statement. However without it. Drupal cannot find the file. So I think there is an issue with that implementation. I had to add the theme registry alter to my own theme as I don't use the glyphicons I wanted to use the fontawesome instead. So there are definitely issues here related to these things.
I am just trying to do a quick over view port of all the different styles and row plugins. Then I will look the right way of implementing that theme registry override.
Comment #9
jorisdrupal commentedWhen I put the
views-bootstrap-carousel.html.twigin
themes/MYTHEME/templates/views/I can override the template.
but the twig debug hinter does not suggest this.
Comment #10
jorisdrupal commentedHere is a working patch,
and you can override as stated above.
Comment #11
hswong3i commentedConfirm patch from #10 works well ;-)
Comment #12
firfin commentedAppleis to dev and works like a charm, RTBC indeed.
Comment #13
poniesLikewise. #10 applied and got me sliding again.
Comment #14
Metal3d commentedPatch applied also, and it works like a charm.
Comment #15
stephen ollmanOUTSTANDING!
Comment #16
jmr3460 commentedWhere does this patch need to be inserted? What file?
OK looking at the patch I believe it is telling me that the file I am dealing with is 'src/Plugin/views/style/ViewsBootstrapCarousel.php' I am looking in the bootstrap folder and I do not have this file. Can someone let me know where this file is Please?
Comment #17
stephen ollmanYou need to create:
- a new file called 'ViewsBootstrapCarousel.php' in a folder at /modules/views_bootstrap/src/Plugin/views/style
- a new folder called 'views_bootstrap_crousel' in a folder at /modules/views_bootstrap/templates
- a new file called 'theme.inc' in the folder at /modules/views_bootstrap/templates/views_bootstrap_crousel
- a new file called 'views-bootstrap-carousel.html.twig' in the folder at /modules/views_bootstrap/templates/views_bootstrap_crousel
From the patch file you'll find the relevant code parts for each of the 3 files you need to create.
Hope that helps.
Comment #18
tunicTo 'insert' the patch you just need to copy the patch file to the module root directory and execute:
patch -p1 < port_carousel_plugin_to-2720791-5.patchGiven that the path file is port_carousel_plugin_to-2720791-5.patch.
You can get more info at https://www.drupal.org/patch/apply
Comment #19
jmr3460 commentedThanks for reply. So with the directions above I am creating empty files and folders and the patch will insert the code, yes?
Comment #20
tunicNo, you don't have to create any file or directory. The patch program should do it for you, because all information needed is in the patch.
I don't know why #17 suggests to do it manually, but it's not the way to do it because the 'patch' program takes care of the process.
Comment #21
stephen ollmanJust helping those that may not be able to update a module using the standard patch method.
Obviously if you know how to patch correctly than the patch command is the way to go.
Comment #22
tunicThen I understand it Stephen. IMHO I'd say it's worth to mention the 'path' way along wih the manual patch applying, just in case user can use that way (usually user just don't know the program).
jmr3460, if you don0t have 'patch' executable you ca use 'git apply'.
Comment #23
platinum1 commentedThe patch has been RTBC for some time. Is there a reason why the patch is not being applied in a new build?
Comment #24
jmr3460 commentedOk Thanks for the help. The patch did create the files and folders it looks like. Now I am off the attempt to create a carousel.
Ok I checked and everything seems to work. You guys have helped my a lot.
Comment #26
mrded commentedComment #27
mrded commentedThank you guys for working on this! Committed to 8.x-3.x branch.