Let's Talk About Fields
Content Type Management
Written by Ercan Özkaya   

My project is mostly about different kinds of fields that will keep data for content types. So I think mentioning them a bit is not a bad idea.

Fields are the things that will generate HTML code for forms and they will also deal with the columns in database that will hold the actual data. They are very much like Joomla! plugins. This makes adding and even developing fields easier.

They consist of two files:

  • An XML file to hold field name, description and parameters.
  • A PHP file to hold the renderer method for the field.

For each field instance, a row in database is created to store parameters and column data. These parameters make each instance configurable. For example, if the field is required to be filled in forms, there will be a parameter for that in params column.

Next thing to mention is PHP classes for fields. They will be similar to JElement derivatives in Joomla! framework. A renderer method will take the database row and output an HTML field for forms. For example, a simple text field renderer will output something like that:

<input name="text_field" id="text_field" class="inputbox required" value="Value coming from database" />

They may be installed using normal Extension Manager of Joomla! in the future (hopefully in 1.6). But for now, I'll have a seperate installer in my component for installing/uninstalling fields.

First thing in my mind before designing this system was to make fields pluggable to allow third party field types. I think this system will give developers some flexibility to create new field types. But if you think something is wrong with this system and have suggestions, I'm eager to hear them.

 

Show other articles of this author

45 Votes

4 Comments

Feed
  1. I am trying to use the custome fields manager but do not see how the font is defined nor how to place it on the screen so it lines up with other lines. One of my fields sticks out to the left and on the details screen, it is in a larger font than the rest. How can I change it? go to visitmanisteecounty.com/member directory/theater group for the instance of the problem. thanks.
  2. It's a great extension. I'm just thinking - isn't it a bit limiting to allow only one field in a database to store the content of the field?

    For example, I want to make a field that is a tagging utility. I can store multiple tags in a single string, but this is a bit limiting in terms of search, no? I would prefer to create a many-to-many relationship with some kind of taxonomy in the background. Would I be able to write such an extension to your CTM?

    I'm currently working on a taxonomy extension (if you are interested, see my joomla taxonomy), and I would like in the end to be able to integrate it with your component via a plugin. Would current plugin architecture of yours allow this?
  3. I think the feature to allow 3rd party field types is a very important one.

    Thank you.
  4. I have a simple question, I was searching for a way to add a custom field to the article manager.
    More specifically I want to be able for each new article I add, to specify the volume number of the newspaper in which this article appeared, and there are currently no fields that would allow me to do that.
    Is the content type project a solution to this issue or is it more related to input forms?
    Thank you for your reply..

Add Comment


    • >:o
    • :-[
    • :'(
    • :-(
    • :-D
    • :-*
    • :-)
    • :P
    • :\
    • 8-)
    • ;-)



    Click to get a new image.