Creation of content elements
The idea behind the content element definition is an abstract, non programming definition of the table structure and logical information about any extention.
Even more, with these generic definitions the component developer does not need to think about multi lingual information or multi lingual translations at all. He just needs to provide a valid content element with his distribution and the end user can use this.
Each of the files within the directory: /administrator/com_falang/contentelements contain one description for a particular component table.
XML structure of a content element
This example shows the content element file of the content component included in the core:
<?xml version="1.0" ?>
<falang type="contentelement">
<name>Contents</name>
<author>Stéphane Bouey</author>
<version>1.0</version>
<description>Definition for the core content component</description>
<reference type="content">
<table name="content">
<field type="referenceid" name="id" translate="0">ID</field>
<field type="titletext" name="title" translate="1">Title</field>
<field type="text" name="title_alias" translate="0">Title Alias</field>
<field type="htmltext" name="introtext" translate="1">Introtext</field>
<field type="htmltext" name="fulltext" translate="1">Fulltext</field>
<field type="image" name="filename" translate="1">Filename</field>
<field type="created_date" name="created" translate="0">Created</field>
<field type="modified_date" name="modified" translate="0">Modified</field>
<field type="checked_out_by" name="checked_out" translate="0">Check out by</field>
<field type="checked_out_date" name="checked_out_time" translate="0">Check out date</field>
<filter>c.state >= 0</filter>
</table>
</reference>
</falang>
Table definition
The XML tag reference describes the defintion of the table and how it should be used. When you assign the content element to a specific table, you should know that the perfix should not be included.
The following list shows possible field types:
Field type | describtion |
---|---|
referenceid | The field that is used to refer to the original content. Normally this is the primary key of your table |
titletext | This is equal to the inputbox tag in HTML, but marks the field as a title |
text | This is equal to normal inputbox tag in HTML |
textarea | This is equal to the normal textarea tag in HTML |
htmltext | This is textarea with WYSIWYG Editor launched |
image | This show you a select system for a text field |
created_date | The date of creation of the item |
modified_date | The date of last of modification of the item |
checked_out_by | Who was the latest user who checked out the item |
checked_out_date | The date when the item was checked out |