|
Cms & Links
|
Cms and Links Different Types of Links The Corinis CMS defines two kind of links:
There are also two ways how links are put into a content page:
It is important to differ between internal and external links, because you normally want external links to open in a new browser window (target="_blank") but internal links should open in the same window. Internal links will also be stored as the id to the document, so when you try deleting a document that has a link pointing to it, you will be notified, while external links need to be caught by the linkchecker. The last speciality of internal links is, that they are styled. You can setup your website using the default ?Document_id= style, or you could use a path-like style (like used in www.corinis.org ). In the database internal links are the id of the document linking to (without any other url information, like '123457896') external links are everything else. Setting the target When working with target frames you need to specify them in the template. This is done by specifying the attributes target and internaltarget (see the wiki ). If an internal link has been found the internaltarget attribute will be used as the final target attribute, the target attribute will be used for external targets. Internal Linkstyle Internal links can be styled by calling Cms.setInternalLinkStyle(String). The string attached is the template used to create strings. If you use taglibs specify the internallink attribute on the cms tags. To clarify this a little here is an example: We have a document /Product/Modules with the id 1128347638089. The normal way of accessing this document would be to say: index.jsp?Document_id=1128347638089 This will happen if you do not specify a linkstyle at all or if you use: ?Document_id=$id You could also create a servlet mapping to your index.jsp and everything that starts with /en will be mapped there. You can now either have a link style like: /en/$id (translates to /en/1128347638089) or you want the whle path to be shown: /en/$path (translates to /en/Product/Modules) If you want to make it look like normal html pages you can append a .html, everything after the . will be ignored. |