Advanced migration topics
This page contains some advanced migration topics which are not required to
get a working result, but to enhance your old templates or content with new
OpenCms 6 features.
Making templates frontend editable
One of the new features in OpenCms 6 is frontside editing. This allows the
content editors to edit page content from the website directly and not by
working in the workplace. To use this new function, the templates must be
enhanced with some easy changes:
Integrate the <cms:editable /> tag in the HTML head of oyur
template:
[...] <html> <head> [...] <cms:editable /> </head> [...] </html>
Set all includes of page elements to editable:
Include in OpenCms 5:
[...] <cms:include element="body" /> [...]
Must be changed to in include in OpenCms 6:
[...] <cms:include element="body" editable="true" /> [...]
For more information about this topic, see the template-howto and the taglib reference.
Folder translation during import
When migrating the content from OpenCms 5 to OpenCms 6 it is possible to move
folders to different locations in the VFS of OpenCms 6 than before. For example,
this feature could be used to move all the galleries - which were located
under /system/galleries/ in OpenCms 5 - to a different location in OpenCms 6. This
makes sense, since OpenCms 6 can access galleries that are stored in any
location of the VFS which was not possible in OpenCms 5.
To enable the folder translation, you must modify the opencms-vfs.xml which
can be found in the OpenCms configuration folder on the server at "[location of
your tomcat]/webapps/opencms6/WEB_INF/config/". In this configuration file, you
must modify the "foldertranslations "node from
<foldertranslations enabled="false"/>
to
<foldertranslations enabled="true">
</foldertranslations>
Inside of this "foldertranslations" node, you can add the single folder
translation rules in Perl RegEx Syntax. Please note that those rules are tested
line by line for each resource to import. The first matching rule will be
excecuted, therefore the order of this rules is important.
Here are some sample translation rules:
<translation> node with regular expression |
Description |
<translation>s#^/system/galleries/pics(.*)#/sites/default/pics$1#</translation> |
Moves the image galleries to the /pics/ folder of the
default site. |
<translation>s#^/oldfoldername(.*)#/sites/default/newfoldername$1#</translation> |
Moves the folder /oldfoldername /to the folder /newfoldername/ in the
default site. |
<translation>s#^/(.*)#/sites/default/$1#</translation> |
Move resources to the default site. |
Important note: To use the folder translations, the import of the
content in OpenCms6 MUST be done in the root site and NOT in the default
site!
|