Writing a TinyMCE plugin for better management of links to anchors for Plone 4
In Produce & Publish Authoring Environment an authoring project consists of several standard Plone Documents residing in the same folder (assume one Document per chapter of a book). Produce & Publish supported references within an authoring project to tables, images and anchors in general. P&P will automatically create anchors for tables and images.
User story
- an editor edits an document and want to reference an image or a table either within the same document or an other document of the authoring project
- the editor highlights the text to be links and clicks on the anchors icon in the toolbar
- a new popup window will open and let the editor choose between two views
- view-by-pages
- a tree-view will show all content pages of the authoring project on the first level and all resources (images or tables) belonging to a particular content page on the second level
- the top-level nodes are colapsable
- view-by-resources (by images, by tables)
- the popup shows three tabs tables, images and anchors
- by clicking one of the tabs all tables/images/other anchors will be shown grouped by page
- the editor can choose one item from the view and the popup will be close itself
- the highlighted text will be turned into a link (<a href="..:"> where the value for href will be taken from the choosen item in the popup
Implementation details
A browser view provided by Produce & Publish will deliver all information about images/tables/other anchors pre-processed as JSON - all data structures will basically match the structure as used in the popups. All related information about texts to be displayed or links to be used, ordering and grouping will be provided by the browser view - no further processing, sorting or whatever should be necessary on the JS level inside the popup.
As a starting point for the Plone integration of such a plugin there is already a module zopyx.tinymceplugins.imgedit available which can be used as a skeleton or example.
The implementation should be very userfriendly and efficient. Usage of jQuery plugins e.g. Dynatree are highly appreciated where suitable.
Contact
Andreas Jung (info@zopyx.com)
