Today we will learn how to add more columns/fields to Joomla *_content table. At first we should have to add a column in *_content table.
Run in for instance phpMyAdmin.
ALTER TABLE `jos_content` ADD `test` VARCHAR( 255 ) NOT NULL
Edit administrator/components/com_content/models/article.xml add:
In the first params section for instance below the access entry. Add
var $test = null;
to libraries/joomla/database/table/content.phpNow add
$form->set('test', $row->test);
to editContent()
in administrator/components/com_content/controller.php
The result is that you now have a new field called test that can be used in various ways to display a separate text that is not a part of the article.
I am building a website with Joomla and have beed trying to look for a tool that would allow me to add custom fields
into articles…after looking at various tools I was also thinking of manually adding the field in jos_content … but did not proceed … cause i was concerned whether i would be affecting the other operations in joomla. But since i have seen your post .. i am more convinced to try it out …
Your instructions :
1. “Edit administrator/components/com_content/models/article.xml add:” ( not sure what to add here in article.xml, can you please explain further…)
2. Also would you know whether modifying the *_content table would cause any issues in the other operations of Joomla?
Also it would be a great learning experience if you could tell me why we have to do each of the steps after manually creating the fields … or maybe you can forward a link to some documentation …
http://forum.joomla.org/viewtopic.php?p=1535340
No comments:
Post a Comment