Content Type Management
Beta 2 Released
Content Type Management
Written by Ercan Özkaya   

Today is the deadline of Summer of Code 2008 which means pencils down after working on the code for about 3 months. In this last day as I promised after first beta, I'm releasing beta 2 which is more robust than the first one. A brief list of changes is as follows:

  • Language files are now ready
  • Database upgrade logic is added for easy upgrade to future releases
  • All known issues listed are fixed
  • Field types are modified in order to make install/uninstalling them possible in the next release

Future Development

You may ask if the development will finish with SoC today. But the answer is definitely no. This is only the first part and it'll be stable after some bug fix releases and development will still go on after that. In fact I could tag this release as RC as it was my original intention in my application. But I wanted to have some more beta time to make it more bug free. I'm hoping to open a site dedicated to this component for better support and communication after project completely finishes.

Download

Download Extend 1.0.0 Beta 2

 
37 Votes

7 Comments

How to create an article with custom fields
Content Type Management
Written by Ercan Özkaya   

After the first beta release it's time to provide some documentation. I'll provide a brief explanation of backend of the component in this post.

Backend contains 4 different sections in itself: article, category, field and type managers. Let's start with the last 2 ones.

Fields are the things that will do component's magic for storing additional data for articles. And types are the containers for them. So as we are storing and grouping articles in categories, we are grouping fields in different types.

So before creating a field you must have a type to put the field in. Then you can start adding as many fields as you want to that type.

Creating types is a quick process. Just click on New button. Write a name and optinially description for your type and also a table name which will be used as an identifier for that type through system. For example for template overrides. You should only use A-Z or 0-9 characters for table name because that will be used as a table name in MySQL. Note that built-in JavaScript validator will warn you for table names if there is a validation error.

Article Type

Next part is creating fields. In Fields section if you click the New button it will provide you all the installed field types with their description and when you click on one you will have a form to complete in order to use that field. It's just like the module creation page of Joomla!. Important fields here are column name and type. They won't be changable after saving.

New fields Field Details

Column name is the name of the column in MySQL table where the storage of data coming from this field type will happen. You should follow PHP variable naming rules. You shouldn't start with a number and you should only use A-Z and 0-9. The only difference is you can't use underscores here.

Then in type dropdown choose the type that we had created a few minutes ago. This will tie this field to the selected article type. So it will be visible in article creation window.

In the right, you can see parameters for validation or if supplied by the choosen field type other things like minimum or maximum length etc.

Now it's time to move on to article creation. Firstly we create a category in categories section in backend. There are two differences here than the core category manager: You are able to create a multi-level category tree and there are default parameters in the right to use when someone reaches that category without a menu item. If there is an active menu item, menu parameters take precedence.

Multi-level categories

Only thing left is to create the article. In articles section when you click on New button, you will see a list of article types. First one is an article without any fields. Just like Joomla! core content. Others are the types you created with your fields. When you choose a type a classic article edit window will load. Here you enter title, category, text of your article just like com_content. And then in the bottom of the editor you will see your custom fields listed in a box. Other things are not that different from the original.

Custom Fields

But I made one last addition to this window. I added a onDisplayForm event to the bottom of the page. So anyone can add a text to this window easily. And if it's a form element, it's possible to catch it using onAfterContentSave event. I hope there will be this kind of event in Joomla! core in a future version.

So this is how you create an article with custom fields. I already explained how to use these fields in frontend in a previous blog post. You can just provide an override and use $this->fields object there. This object is loaded with all your custom field data. Another way of using custom fields will be possible in a near future with the creation of one plugin. You will just add for example {field:email} and it'll show the custom field named email. But this feature does not exist yet on this beta.

My next blog post will be about a more practical example. I'll show how to create an image gallery with categories, captions etc. in a very short time without using any other gallery component.

You can download my latest release here.

 
42 Votes

6 Comments

First Beta Released
Content Type Management
Written by Ercan Özkaya   

After 2 and a half months of developing and bug fixing I guess it's time to release the first beta of my component. So what's the current status of the component?

The vital parts for backend and frontend are finished. A field installer and component upgrader are going to be the next additions before stable version of 1.0.0. This beta does not feature them. Right now, it is a little bit buggy and hopefully with thorough testing of this release things will be much better in future releases.

System Requirements

Extend requires at least PHP 5.2 and MySQL 4.1 to function properly. Although PHP 5.1.x and 5.0.x versions are very likely to work, they are not supported officially. This decision were made after Joomla! decided to go with the same requirements for 1.6.

Known Issues

  • Right now, there is a problem with parameters and if you can't make your article title, creator etc. not show, try going to component parameters in backend and save them. This work around should do it till I solve this in next release.
  • Language files are not completed yet. So if you see some weird language strings, it's because of that.
  • Type tables are not removed after uninstallation. So you should delete tables starting with jos_extend_types_ afterwards

Download

A final note: This release still contains a lot of bugs and not ready for production environment yet. So please use it only in your test sites. Your feedback is greatly appreciated.

Download Extend 1.0.0 Beta

 
33 Votes

4 Comments

Override System Of Extend
Content Type Management
Written by Ercan Özkaya   

As some of you may already know it's possible to override the HTML output of components or modules by using layout files in your template. If you are interested in a great resource about overrides here is one from Andrew Eddie

Our topic here is how to use overrides for specific content types in Extend. First of all let's start with type creation

Article Type

Table name field in the image is used for the database table created specifically for that content type. So in this case jos_extend_types_gallery will be created after saving. This field has one more purpose. It's the general identifier of types for overrides.

You will see a directory called layouts in components/com_extend. If we follow our example we should create the following directory structure for our custom layouts:

/components
	/com_extend
		/layouts
			/gallery 			(matches the type table name)
				/article 		(matches the view directory name)
					default.php 	(matches the layout file name)
				/category
					blog.php
					blog_links.php
					...

You don't have to override all layout files in a view directory. You can just put what you want to change. You also don't have to create overrides for both article and category views. You can override either one or both.

So this way you can create a gallery category view which lists thumbnails of images and link them to article pages. Then you can have a lightbox effect in article view. There are many possibilities

Later today, I'm planning to release the beta version of my component. So if you want to try it yourself stay tuned!

 
37 Votes

0 Comments

Introducing Extend
Content Type Management
Written by Ercan Özkaya   

2 months ago, on May 26th coding started for Summer of Code. In these 2 months, I published some blog posts about my progress and of course wrote some code.

In my last blog post I promised to provide an installable package soon. So now it's time to have something more concrete for you to test.

Please remember that this is a pre-alpha release and only features the backend of the component. Most of the functionality in backend is now complete. Here are a few details about what is complete and what is coming soon:

What is implemented

  • Article manager
  • Category manager
  • Type manager
  • Field manager
  • PHP and JavaScript validator
  • 2 field types for demonstration

What is missing for now

  • Language files
  • Most of the field types
  • Some HTML helpers for validation
  • Frontend of the component

The name of the component - Extend - is a suggestion of Amy Stephen. She has been so helpful through my project for anything I needed and I want to thank her again for finding such a good name and for her support. There could be hardly any other thing that reflects the idea of this component this well.

You can download it here and give it a go in your test site. Please report any kind of feedback in comments so that I'll know the thought of the community and drive the future development using them.

 
34 Votes

5 Comments

My Work So Far
Content Type Management
Written by Ercan Özkaya   

Now the midterms are over and I'm pushing hard to stay on my schedule for the project. I have to admit that I was a little bit slow for the last 10 days but I had a chance to look at my previous code over for some overhaul.

Currently, I finished the 4 major parts of back-end: Article, category, type and field managers. But there is still work needed, like connecting this parts together, creating all the field plugins needed, stricting the validations and *hopefully* writing some tests for my classes. After that the time for working on front-end will come.

And starting from my next post to this page, I'm planning to provide an installable package of my work so far in each post for you test the component easily without dealing with SVN.

This is it for now. I'll post updates more frequently in the future. Stay tuned!

 
30 Votes

2 Comments

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.

 
33 Votes

4 Comments

What's been going on
Content Type Management
Written by Ercan Özkaya   

It's been a long time since I blogged last time. This is mainly because I'm (of course) a student and a theory says that students shouldn't live their normal lives during final exams.

But during this period I haven't fully stopped working on my project. Right now, the back-end system has a complete category and article manager that has most of the content management features needed. You can take a look at the code in our repository. I also read the great book "Mastering Joomla! 1.5" by James Kennard which is donated by PacktPub. I want to thank PacktPub for their generosity and support to the project and also to our project coordinator Wilco Jansen for arranging this for us, GSoC students.

What's next

Now the backbones of the content component is ready. It's time for the fancy part of my project. I'm going to start working on field manager and field types next. I will also be blogging about it with details of the implementation soon. And then the time will come to combine the fields with the content types.

What you can do...

I believe in the open source world, the community feedback should be a very important part of the future plans of projects. So as I stated in my first post, your feedback will be greatly appreciated during the whole summer.

And don't forget that this baby still has no name. So you can be the one to name it!

 
31 Votes

3 Comments

Getting Started
Content Type Management
Written by Ercan Özkaya   

Now we are approaching to the end of community bonding period and there's only a little time left before coding starts. So before getting started, I wanted to make a more detailed explanation of my project and *hopefully* get some feedback from the community.

In my opinion, different content types are one of the most common needs for a CMS. This feature would result in reducing the number of components by combining most of them with a single content component and also allow flexibility with little effort. So, if anything goes as expected, I'll implement this functionality this summer with the guiding of my great, helpful mentor Jason Kendall.

But although the project is about content types, my component will also be a content component just like com_content. So the first thing I'm doing is to fork com_content and chop it cruelly. In my version, there won't be any sections and categorization will be based on nested categories. I'll also take out some features like voting, frontpage view (to replace with a different implementation that allows multiple frontpages at a later point)

If we continue talking about content types, they will be based on fields like textarea, checkbox, radio button etc. By combining the needed fields, you'll be able to create what you want. For example, you can create an image gallery by adding an input box for image link, a text area for image description and some fields for image metadata. Then by creating a template, you'll be able to show it the way you want in your site.

To add a new content item, you'll be prompted to select the content type you want among a list of your existing types. Then a form will be generated with all the fields for that type. So once you set up your content type and create your template (which may require a developer hand) any user in your site will be able to create new items easily.

Above is the skeleton for what I'm building. But not only me, our community -which means you- will use this component. So your feedback is more than important. If you have any ideas, wishes, criticism, bad words please shoot them in comments. They are greatly appreciated.

 
32 Votes

4 Comments

Team: Content Type Management
Content Type Management
Written by Amy Stephen   

Ercan Özkaya

 

Ercan Özkaya is a Mathematics student at the Selçuk University in Konya, Turkey. He has used Joomla! for two years. Ercan started using Joomla! as a site developer and found that he enjoyed building Joomla! Web sites so much that he wanted to learn how to develop extensions. As a result, he developed, contributed, and maintains two very popular extensions: Title Manager and Author Details. He is a member of the Joomla! Bug Squad where he submits patches and helps with testing. Ercan is excited to participate in the GSoC program.

Jason KendallMentor: Jason Kendall started his journey in the computing industry with Pong, moving next to Commodore 64 where he developed utilities in Basic. Then, he turned ten. In school, Jason ran 'The BBS Enterprise', became a regular poster on the Fido Network and was introduced to the Internet. Since then, he's explored VoIP, IPv6, and began developing in PHP in 2000. Professionally, Jason is an Information Security Analyst. He was invited to join the Joomla! Development Team after contributing patches for RSS feeds, LDAP integration and OpenID.

 
39 Votes

0 Comments

<< Start < Prev 1 2 Next > End >>

Page 1 of 2