Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / Resource Registry

Resource Registry

Resource Registry 簡化 JavaScript 和 CSS 的開發和設定,讓 Plone 5 提供更符合 JavaScript 主流演化的路徑,也可透過網頁介面來執行設定和編譯的工作。

Resource 和 Bundle 註冊在 Products.CMFPlone/profiles/dependencies/registry.xml 檔案裡,預設 Bundle 共有 plone, plone-logged-in, plone-legacy, resourceregistry 但只有前三個是 Enabled 狀態,第二個 merge_with 選項是 logged-in,其他是 default。初期的擴充介面並不穩定

example: Dict Field with Multiple Field Values

由於 JavaScript 生態系的相依關係日益複雜,演化出 Asynchronous Module Definition (AMD) API 之類的方案,新生代的開發工作,常結合 Bower, Grunt, RequireJS, Less 等工具,為了讓 Plone 能直接引用這些成果,藉由 Resource Registry 新機制,讓 Plone5 可以透過網頁介面簡化 RequireJS 和 LESS 的開發,但學習上需要先認識基礎觀念

RequireJS 是符合 AMD API 的一項,

DataTables behaves differently if it's loaded when RequireJS is present (as it is in Plone5) than when t is not.

AMD or No AMD? Resource Registry aimed to provide a TTW way to define javascript modules and do dependency management

Moving JS / CSS to Plone5 Resource Registry: collective.geo.openlayers plone.app.imagecropping

Reserved Names from RecordsProxy Recursion Error

For legacy resources, define and require are unset before inclusion and re-set afterwards.

collective.js.fullcalendar

JavaScript 文件範例

Programmatically Access List of Resources in Plone5 Registry https://community.plone.org/t/improper-resource-urls-generated-in-plone-5-0-5/2426/10