plonediazo

Using Same Folder for Diazo Theme and ZCML resourceDirectory


With documentations for Resource Folder and Diazo Resources, guess that I can create a resource folder respectively as follows:

<!-- ZCML resourceDirectory -->
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser">

  <browser:resourceDirectory
      name="my.theme"
      directory="resources" />

</configure>

and

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

  <plone:static
      name="my.theme"
      directory="resources"
      type="theme" />

</configure>

My questions are: Can I use one same directory to meet needs for both resource folder registration? If not appropriate, what issues should happen?


Solution

  • Theme directories are really just a special case of resource directories. They tell the plone.app.theming apparatus to "look here" for it's manifest and other supporting files. You may use a theme directory otherwise just as you would a resource directory. You'll just use "theme" rather than "resource" in the URLs.