CMS_LINKEDITOR
The content type CMS_LINKEDITOR allows to specify a link, which can be displayed using the CMS_LINK content type.
The usage is quite simple, put the code below in your output modul section and you are finished.
The name CMS_LINKEDITOR specifies which content type should be used and [1] is the index of headline. The index must be integer value.
Note
If you are using more then one CMS_LINKEDITOR per article, you have to change/increment index of the next CMS_LINKEDITOR .
echo "CMS_LINKEDITOR[1]"; or echo "CMS_LINKEDITOR[100]";
Configuration
The configuration of CMS_LINKEDITOR is split in three different sections.
To configure the link click on the blue link icon (see screenshot below).
Tab: External link
In the first tab External link you can input an external link, that means it will link outside CONTENIDO to some another page.
Href ist the hyper reference to the other website, title ist the name ot the link, which describes href.
The link can be opened in a new window, if you want to. Just check the checkbox.
After you entered a link you can save configuration by clicking on the green checkmark or discard all changes by clicking on the red cross.
Tab: Internal link
In the second tab Internal link you can specify a link to another CONTENIDO article.
Select a category in the left category tree and all possible links will be shown on the right side of dialog.
Select the article you want to link to, input a title and save it.
Tab: Link to a file
In the last tab Link to a file you can link to an uploaded file.
Select the folder in the left tree and its content will be shown on the right. You can link to any file.
Every Tab
In every you can enter a title for the link. This titel can be read programmatically using the CMS_LINKDESCR content type.
Furthermore you can let it open in a new window. This target can be read programmatically using the CMS_LINKTARGET content type.
Methods for CMS_LINKEDITOR
List all methods for CMS_LINKEDITOR at our API documentation.
Function name | Description |
---|---|
getLinkType() | Returns the link type ('external', 'internal' or 'file') |
getTitle() | Get the displayed title for link |
getTarget() | Returns the link target (e.g. "_blank") |
getLink() | Returns the href of the link |
getConfiguredData() | Returns array with configured data. Additionally the key href contains the actual hyperreference. $returnValue = array( "type" => "external", // external, internal, file "externallink" => "http://www.4fb.de", // for external links "title" => "four for business AG" "newwindow" => "", "idart" => 0, // for internal links "filename" => "", // for files at filemanager "href" => ); |
generateViewCode() | Generates the code which should be shown if this content type is shown in the frontend. |
generateEditCode() | Generates the code which should be shown if this content type is edited. |
buildCategoryArray() | Builds an array with category information. $returnValue = array( "idcat" => 0, "name" => "Test category", "sub" => 0); |
getCategoryList() | Generates a category list from the given category information. |
generateArticleSelect() | Generate a select box for all articles of the given idcat. |
getUploadFileSelect() | Generates a select box for the manual files. |
Code Example for CMS_LINKEDITOR
Here is an example how you get the Data, which was assignd via CMS_LINKEDITOR in the Backend to use it inside of your Modules:
// Create a Contenttype inside of your Module dynamicly // e.g use this in Loops instead 'echo "CMS_LINKEDITOR[15]";' Â if (cRegistry::isBackendEditMode()) { echo stripslashes($ocType->getGeneratedCmsTag("CMS_LINKEDITOR", 15 ));// CMS_LINKLIST (generate Contenttype with ID 15 "CMS_LINKEDITOR[15]") } // get the ArticleLanguage Object of current Article $art = new cApiArticleLanguage(); $art->loadByArticleAndLanguageId(cRegistry::getArticleId(), cRegistry::getLanguageId()); // load "RAW"-Setting to paste it as Parameter for cContentTypeXXX $settings = $art->getContent("CMS_LINKEDITOR", 15); Â // get the CMS_Contenttype Object to fetch Data from it $lnT = new cContentTypeLinkeditor($settings, 15, array()); // Use some of the above described Methods on this Object $url = $lnT->getLink(); $urlTitle = $lnT->getTitle();