SilverStripe Swipestripe - swipestripe-gallery 模块错误

SilverStripe Swipestripe - swipestripe-gallery module error

我已经安装了 Swipestripe 模块。并为产品图片添加了 swipestripe-gallery 模块。 当我做 dev/bulid?flush=1 它显示错误 Class 'Gallery_PageExtension' 不存在 我在 swipestripe-gallery/_config 文件夹中看到 gallery.yml 文件,其中有

Product:
   extensions: 
     - 'Gallery_PageExtension'

但是 class 不在 swipestripe-gallery/code 文件夹的 Product.php 文件中。 在评论上面的代码后,我做了 dev/build?flush=1 并且没有错误。但在产品页面中,未添加图库选项卡。 请帮助。

Swipestripe 的配置没有该代码:https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml

它的图库模块:https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml

这是两个独立的模块。如果像你说的那样图库文件在 swipestripe/_config 中,那么在我看来安装没有按预期进行。

你的安装根目录下应该有两个文件夹

  • 滑动条纹/
  • swipestripe-图库/

与每个模块相关的所有文件都应该在每个(单独的)文件夹中。看来您一起缺少 swipestripe-gallery 文件夹,这意味着 class 实际上不存在(当您收到此错误时,只需检查 class 是否存在于安装中的某处。使用grep 是最简单的方法)。

你不是用composer安装的?你的错 ;) 它会为你安装所有要求,你可以快乐地编码。

请参阅 https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements, you'll need to install https://github.com/frankmullenger/silverstripe-gallery 在您的代码库中获取此图库扩展。

我强烈建议您使用 composer 安装所有模块。一开始可能有点难,但过几天你的生活就会舒服很多! A good introduction can be found in the ss docs.