首页 \ 问答 \ Plone / Grok - 在使用“zopeskel plone”构建的产品中,能否与plone.directives产生冲突?(Plone/Grok - In a product built using “zopeskel plone”, can grok conflict with plone.directives?)

Plone / Grok - 在使用“zopeskel plone”构建的产品中,能否与plone.directives产生冲突?(Plone/Grok - In a product built using “zopeskel plone”, can grok conflict with plone.directives?)

我正在尝试按照Plone文档站点上的教程构建一个控制面板。 http://docs.plone.org/develop/plone/functionality/controlpanel.html

但是,我开始使用(来自src文件夹)../bin/zopeskel plone my.product创建产品,而不是使用dexterity选项创建。 当我询问我想要什么模式时,我确实选择了简单选项,当我询问是否要创建GS配置文件时,我确实选择了是。

我确保在configure.zcml中包含grok

<include package="five.grok" />

按照说明操作后,我尝试运行quickinstall来安装产品,但它给了我错误:

ImportError: No module named directives 

指的是他们教程的settings.py文件中的行

from plone.directives import form 

我将plone.app.registry添加到setup.py文件中的install_requires位,我确保在configure.zcml文件中进行更改以包含Just for experimenting,我确实将'plone.app.dexterity'添加到了install_requires,但我仍然遇到同样的错误。

Grok与plone.directives冲突吗? 如果是这样,我该如何解决这个问题,还是必须使用威慑而不是plone作为创建产品的选项? 如果grok没有冲突,问题是什么?

在附注中,本教程似乎是用灵巧来创建产品的,但我不确定这是否是问题所在。


I am trying to build a control panel following a tutorial on the Plone Documentation site. http://docs.plone.org/develop/plone/functionality/controlpanel.html

However, I started off creating the product with (from the src folder) ../bin/zopeskel plone my.product, instead of creating with the dexterity option. I did select the easy option when it asked what mode I wanted and I did select yes when it asked if I wanted to create a GS Profile.

I made sure to include grok in configure.zcml

<include package="five.grok" />

After following the instructions, I try to run the quickinstall to install the product, but it gives me the error:

ImportError: No module named directives 

referring to the line in the settings.py file of their tutorial

from plone.directives import form 

I added plone.app.registry to the install_requires bit in the setup.py file, and I made sure to make the changes in the configure.zcml file to include Just for experimenting, I did add 'plone.app.dexterity' to the install_requires, but I still got the same error.

Is grok conflicting with plone.directives? If so, how can I fix this or do I have to use deterity instead of plone as the option for creating products? If grok is not conflicting, what could the problem be?

On a side note, the tutorial does appear to be for using dexterity to create the product, but I am not sure if that is what the problem is.


原文:https://stackoverflow.com/questions/27783677
更新时间:2021-11-30 07:11

最满意答案

假设您在条目js中导入bootstrap 4:

import 'bootstrap/scss/bootstrap.scss';

...尝试以下插件设置:

const extractScss = new ExtractTextPlugin({
  filename: 'assets/css/[name].[contenthash].css',
  allChunks: true
});

...将以上内容添加到您的插件数组中:

plugins: [extractScss]

......然后在你的规则中:

{
  test: /\.scss$/,
  use: extractScss.extract({
    fallback: 'style-loader',
    //resolve-url-loader may be chained before sass-loader if necessary
    use: ['css-loader', 'sass-loader']
  })
}

所以构建你的ExtracTextPlugin很重要,在这里我已经设置了

const extractScss = new ExtractTextPlugin(...)

这样,在您的规则配置中,您将传递相同的对象。 在上面的代码中,您使用的是ExtractTextPlugin的导入实例,而不是您在插件数组中创建的新实例(没有设置选项)。

你可能不得不调整插件选项中的文件名,我的设置就像资产/ css / main.awef32fq23faf23aasdf.css


Assuming you are importing bootstrap 4 like so in your entry js:

import 'bootstrap/scss/bootstrap.scss';

...try the following plugin setup:

const extractScss = new ExtractTextPlugin({
  filename: 'assets/css/[name].[contenthash].css',
  allChunks: true
});

... add the above to your plugins array:

plugins: [extractScss]

... and then in your rules:

{
  test: /\.scss$/,
  use: extractScss.extract({
    fallback: 'style-loader',
    //resolve-url-loader may be chained before sass-loader if necessary
    use: ['css-loader', 'sass-loader']
  })
}

So it's important to construct your ExtracTextPlugin, here I have mine set to the

const extractScss = new ExtractTextPlugin(...)

That way later on in your rules configuration you are passing the same object. In your code above you are using the imported instance of ExtractTextPlugin not the new one you created in your plugins array (which has no options set).

You'll probably have to adjust the filename in the plugin options, mine is set to go to something like assets/css/main.awef32fq23faf23aasdf.css

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。