Namespacing your channel elements to avoid conflicts is very important. To ensure that two channel elements do not conflict, unique names for elements have to be used.
Channels names can be made unique by any of the following ways:
Add the channel name to elements in a JSP Provider channel as follows:
var <%jsChannelName%>_name = "test"; <%=jsChannelName%>_doSomething = function() { ... } ... <div <%jsChannelName%>_content"></div> |
Add the portlet namespace in a JSR-168 channel as follows:
<portlet:namespace/>_loadInvoice = function (invoice) { ... <div id="<portlet:namespace/>_content"></div> |
In static content that does not use JSP, use tokens:
var %{CHANNEL_NAME}_name = "test"; %{CHANNEL_ID}_doSomething = function() { ... } |