Aloha Page Link Tag Description

A special tag-type may be defined, which will be used by Aloha to create internal link tags.

The tag-type must have the keyword “gtxalohapagelink”. Also, the internal definition must be equivalent to the one found in the screen-shot below – in particular, the part-keywords “url”, “fileurl”, “text”, “class” must be identical.

Contents of the part “Template”:


#if( "$!cms.tag.parts.title" != "" )## 
#set( $escapedTitle = $cms.imps.velocitytools.esc.xml($cms.tag.parts.title) )##
#set( $title=" title='$escapedTitle'" )## 
#end## 
#if( "$!cms.tag.parts.target" != "" )## 
#set( $target = " target='$cms.imps.velocitytools.esc.xml($cms.tag.parts.target)'")##
#end## 
#if( "$!cms.tag.parts.url" != "" )## 
#if( "$!cms.tag.parts.url.target.id" != "" )## 
#set( $data = " data-gentics-aloha-repository='com.gentics.aloha.GCN.Page' data-gentics-aloha-object-id='10007.$cms.tag.parts.url.target.id'" )## 
#else## 
#set( $data = " data-gentics-gcn-url='$cms.imps.velocitytools.esc.xml($cms.tag.parts.url)'" )##
#end## 
#set( $href = $cms.tag.parts.url )## 
#else## 
#set( $data = " data-gentics-aloha-repository='com.gentics.aloha.GCN.Page' data-gentics-aloha-object-id='10008.$cms.tag.parts.fileurl.target.id'" )##
#set( $href = $cms.tag.parts.fileurl )##
#end## 
#if( "$!href" == "")##
#set( $data = " data-gentics-gcn-url='#'" )##
#set( $href = "#")##
#else##
#set( $href = $cms.imps.velocitytools.esc.xml($href))##
#end##
<a$!title$!target href="$href" class="$!cms.tag.parts.get('class')"$data>$!cms.tag.parts.text</a>##

The hashes in the content are important as they are velocity comments to prevent the rendering of new lines. If not all newlines are stripped out, the tag will be wrapped with a DIV in the edit view.

This tag-type must be linked to each node (root-folder) that has Aloha enabled.

A user can then create an internal link by inserting a link with the Aloha floating menu, and by beginning to type the name of the page/file he wants to link to. A number of suggestions will be displayed that match the typed text. Selecting one of the suggestions with the cursors-keys and confirming the selection with the enter-key will create the link tag once the page is saved.