Displaying snippet tabs - tooltwist/documentation GitHub Wiki
Snippets used by a widget may be displayed as tabs in the Designer, allowing non-programmers to edit them.
To have a tab display, add an entry to the conf.xml file.
<editableSnippet>
<name>pageTitle_cssHeader.css</name>
<theme>project</theme>
</editableSnippet>
When the snippet is edited, it overrides the default snippet stored in the widget's original definition.
The theme parameter is normally set to "project", indicating that the overridden content is specific only to the current project. In the future this will be able to be set to other values, allowing different snippets to be used when generating pages in different contexts.
Note that changes to these files are saved in the web design project, not in the project containing the actual widget.
One major advantage of this feature, is that it allows Web Designers and other people familiar with HTML, CSS, etc, to alter the appearance of widgets independently of the programmers writing the widgets.
Once the appearance has been adjusted, the web designer can notify to programmer to copy the snippets back to the original widget's configuration directory. (In a later version this will be more automated)
Tabs to edit snippets are only displayed if the user has the correct file permissions. The following roles are used:
- Edit JSP (ttDesigner-jsp) - to modify snippet with .html or .jsp extension.
- Edit CSS (ttDesigner-css) - to modify snippet with .css extension.
- Edit Javascript (ttDesigner-javascript) - to modify snippet with .js extension.
In v8.1 we now bypass the menu by default, so you'll need to temporarily access the menu again while you update user permissions. See https://github.com/tooltwist/documentation/wiki/Bypassing-the-menu for how to do this.
--