SilverStripe Swipestripe - swipestripe-gallery module error

173 views Asked by At

I've installed Swipestripe module. and added swipestripe-gallery module for product images. when I did dev/bulid?flush=1 it shows error Class 'Gallery_PageExtension' does not exists I have seen gallery.yml file in swipestripe-gallery/_config folder, which has

Product:
   extensions: 
     - 'Gallery_PageExtension'

but this class is not there in Product.php file in swipestripe-gallery/code folder. After commenting above code I did dev/build?flush=1 & there was no error. But in product page the Gallery tab is not added. Please Help.

2

There are 2 answers

1
wmk On BEST ANSWER

You didn't install using composer? Your fault ;) It installs all requirements for you and you can code happy.

See https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements, you'll need to install https://github.com/frankmullenger/silverstripe-gallery for getting this gallery extension in your codebase.

I strongly encourage you to install ALL modules with composer. It may be a bit hard in the beginning, but in some days your life will be much more comfortable! A good introduction can be found in the ss docs.

1
user5023089 On

Swipestripe's config does not have that code: https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml

The gallery module for it does: https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml

These are two separate modules. If the gallery file is in swipestripe/_config as you say, then it would seem to me that the install didn't happen as it should.

There should be two folders in your installation root

  • swipestripe/
  • swipestripe-gallery/

All files relating to each module should be in each (individual) folder. It seems you're missing the swipestripe-gallery folder all together, meaning that the class in fact does not exist (When you get this error, just check that the class exists somewhere in your install. Using grep is the easiest way).