Home Dokumentation Entwickler Doku Creation of Content Elements
Creation of Content Elements PDF Drucken E-Mail
Geschrieben von: Ivo Apostolov   
Donnerstag, den 26. April 2007 um 01:44 Uhr
Keine Übersetzungen vorhanden.

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_joomfish/contentelements contain one description for a particular component table.

Since Joom!Fish 2.0 there is a naming convention for the content element files within this directory. Each of the files must have the same name as the table you like to translate.

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" ?>
<joomfish type="contentelement">
<name>Contents</name>
<author>A. Kempkens</author>
<version>1.7</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="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>
</joomfish>

 

 

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 typedescribtion
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
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
 

6 Comments

  1. Hi, i think "file" type is very important, but i dont see that in the list of types. regards,
  2. The table above is missing the 'int' type. Is there a float or decimal type too?
  3. The most easy way to identify the tables created by any extension is to look inside the manifest.xml of the extension. There is a section called which describes exactly these tables.
  4. Ok, I'm a layman, but the structure above looks simple enough that I am tempted to try my hand at creating a content element definition for a registration module I am using. What I'm struggling with is how to find out the table name used by the developer and the reference type: The rest looks pretty straightforward. I have a component and a module installed. How do I go about finding out which tables are used? Thanks, Ruedi
  5. Isn't there a way to include a field type "file"??
<< Start < Zurück 1 2 Weiter > Ende >>

Add Comment

 
joomfish_2.0_download

Selected Contributors

From the Joom!Fish Core team (Alex, Geraint & Carolien) a big thank you to all the people of the JoomFish community!
A special thank to Harri for the moderation in the forum and all our translators.

Leseempfehlung

Joomla! Entwicklerhandbuch