Hello everybody.
I want to place a new field in the categories in Phoca Gallery. I edited the administrator/component/com_phocagallery/views/phocagalleryc/tmpl/form.php. I made a new line in the code, and created a new input field, and I wrote this "<?php echo $this->items->city; ?>" to the input's value, and it worked, because I previously edited the database, made a new column, and write something as value to the category.
My question is, that what file should I edit to can edit this field value in the administrator view of categories(when I want to edit the category)?
Right now Phoca gallery only write the line value to the field, but if I edit this value nothing happen when I saved the category.
Sorry for my English, I hope somebody can help me.
Thanks a lot, bye.
KJ.
New custom field in category
-
reko
- Phoca Professional

- Posts: 407
- Joined: 29 Dec 2008, 22:06
Re: New custom field in category
Hi,
take a look at the files (named correspondingly to the view name) in the administrator/component/com_phocagallery/models and administrator/component/com_phocagallery/helpers folders. I'm not a programmer though, but i think these are the files you need to edit...
regards,
rk
take a look at the files (named correspondingly to the view name) in the administrator/component/com_phocagallery/models and administrator/component/com_phocagallery/helpers folders. I'm not a programmer though, but i think these are the files you need to edit...
regards,
rk
-
kovj89
- Phoca Newbie

- Posts: 2
- Joined: 30 Oct 2010, 10:43
Re: New custom field in category
Hi!
Thank you for your answer, I find the solution of my problem, and I share it, maybe it will be useful for somebody once.
It is not so complicated, just have to write 2 rows to 2 file, and that's all.
First of all, you have to add the input field to the category form, which is at administrator/component/com_phocagallery/views/phocagalleryc/tmpl/form.php. Of course you have to add a new column to the ..phocagallery_categories database table.
After that you have to add your new field as a variable to administrator/component/com_phocagallery/controllers/phocagalleryc.php near line 40, in the save() function. You have to add a new line similar as previously writen there. If you want to add a string or int you can see how it works.
Than, you have to add one more line to another file. It is at administrator/component/com_phocagallery/tables/phocagalleryc.php at row 15. You have to add your input field name as a php variable, and have to define a value which is null.
That's all, I hope it was useful, Bye.
KJ.
Thank you for your answer, I find the solution of my problem, and I share it, maybe it will be useful for somebody once.
It is not so complicated, just have to write 2 rows to 2 file, and that's all.
First of all, you have to add the input field to the category form, which is at administrator/component/com_phocagallery/views/phocagalleryc/tmpl/form.php. Of course you have to add a new column to the ..phocagallery_categories database table.
After that you have to add your new field as a variable to administrator/component/com_phocagallery/controllers/phocagalleryc.php near line 40, in the save() function. You have to add a new line similar as previously writen there. If you want to add a string or int you can see how it works.
Than, you have to add one more line to another file. It is at administrator/component/com_phocagallery/tables/phocagalleryc.php at row 15. You have to add your input field name as a php variable, and have to define a value which is null.
That's all, I hope it was useful, Bye.
KJ.