简体   繁体   English

如何在主 configure.zcml 中配置配置文件目录以创建自己的视图

[英]How to configure profiles directory in main configure.zcml to create a own viewlet

I am trying to create a own viewlet to change the default plone site using viewlet.I created viewlets.xml file under profiles/default directory.In the viewlets.xml file contains the code to hide the default plone logo.I registered profiles directory in main configure.zcml file like this我正在尝试创建一个自己的 viewlet 来使用 viewlet 更改默认的 plone 站点。我在配置文件/默认目录下创建了 viewlets.xml 文件。在 viewlets.xml 文件中包含隐藏默认 plone 徽标的代码。我在中注册了配置文件目录像这样的主 configure.zcml 文件


configure.zcml配置文件

<plone:static directory="profiles" type="theme"/> 


<include package=".profiles" /> 

But while creating instance am getting error like this IOError: [Errno 2] No such file or directory: '/home/oomsys/brundelre3/src/bdr.theme/src/bdr/theme/profiles/configure.zcml'但是在创建实例时出现这样的错误 IOError: [Errno 2] No such file or directory: '/home/oomsys/brundelre3/src/bdr.theme/src/bdr/theme/profiles/configure.zcml'


pls anyone help me.. still im in struck请任何人帮助我..我仍然受到打击

You do not need to register the profiles directory.您不需要注册profiles目录。 It's automatically picked up by Generic Setup .它由Generic Setup自动选取。

EDIT编辑

You do have to register the profiles directory but with a ZCML stanza like this:必须注册profiles目录,但与ZCML节是这样的:

<configure
  xmlns="http://namespaces.zope.org/zope">

  <includeDependencies package="." />

  <genericsetup:registerProfile
    name="default"
    title="PACKAGE.DOTTED.NAME"
    directory="profiles/default"
    description="DESCRIPTION"
    provides="Products.GenericSetup.interfaces.EXTENSION"
    />

</configure>

Once you install your package it will automatically run all the xml files within profiles/defualt .一旦你安装了你的包,它会自动运行profiles/defualt所有 xml 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Plone:configure.zcml中的未绑定前缀 - Plone : unbound prefix in configure.zcml 什么是portlet / configure.zcml上的“view_permission”? - What is “view_permission” on portlet/configure.zcml for? 如何在 browser/configure.zcml 中使用 config.py 和 __init__.py(使用 paster)创建的权限来获得自定义权限? - How do I use a permission created by config.py and __init__.py (using paster) in browser/configure.zcml for a custom permission? 如果用户没有渲染视图的权限(在configure.zcml上配置),我如何提高禁止访问权限而不是重定向到login_form? - If a user doesn't have permission to render a View (configured on configure.zcml), how do I raise Forbidden instead of redirecting to login_form? 在Plone中注销一个zcml资源目录 - Unregister a zcml resource directory in Plone 如何通过plone对象url获取viewlet - How to get viewlet by an plone object url 如何将documentactions viewlet从viewletmanager移动到另一个? - How to move the documentactions viewlet from a viewletmanager to another? 如何在开发人员Facebook中配置设置? - how to configure settings in developer facebook? 如何覆盖ore.viewlet.core.FormViewlet中的zope.formlib @ form.action方法 - How to override a zope.formlib @form.action method in a ore.viewlet.core.FormViewlet 覆盖视口不那么普遍 - Override viewlet to be less pervasive
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM