tibin mathew
tibin mathew

Reputation: 2084

Adding new fields in joomla 2.5 article component

Anybody know how to add custom fields, new fields to enter some values with joomla 2.5 articles in backend.

I want to add some values when i create an article and want to get these values in frontend.

Is there any way i can do this??

Any help will be appreciated.

Thanks in Advance Tibin Mathew

Upvotes: 1

Views: 1908

Answers (2)

Danijel
Danijel

Reputation: 867

I think Joomla team predicted that in some way:

Joomla step by step

Upvotes: 1

Patrick Evans
Patrick Evans

Reputation: 42756

you would have to

Modify the _content database table

_content is the suffix name of the table that contains all the articles. If you want to add new fields you have to modify this database table to reflect those new fields.

com_content files

com_content is the component in control of articles in both the frontend and backend. It can be found under the components folder under the main directory, and in the administrator/components folder under the main directory. The files in com_content control how the articles are displayed how the form is displayed how actions like save unpublish etc work. So these files will have to be edited to work with your new fields

xml files in the models/forms models/fields

There are XML files under these folders within the com_content folder that tell how the edit form of articles are supposed to be viewed, what type of fields are used, etc. These will have to be modified to reflect your new fields

then you have to do it all again

Each update has updates to the core files (com_content is a core component so all its files are core files). If you go about editing the files in com_content and then do an update these files are more then likely will be overwritten by the update basically losing your modifications. So you would have to redo the modifications.

It is better to make your own component

Upvotes: 0

Related Questions