Welcome, Guest
Username: Password: Remember me

TOPIC: Add a new field manually?

Add a new field manually? 01 Nov 2012 04:46 #4872

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
I have a component almost completed, but client has asked for a new field in the database in one of the tables. I have made some customisations to my scripts.

Is anyone able to tell me what scripts I need to update if I was to add the new field into the database manually (via phpMyAdmin)? I need to get the value in this field to the user via a flysheet.

My component is built with Cook v1.5

thanks,
Geoff
The administrator has disabled public write access.

Re: Add a new field manually? 01 Nov 2012 07:49 #4875

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
I would add it manually in your database as you mentioned then;
  1. Add the field to you SQL install files
  2. Add the field in all of your SQL queries in your table's model file.
  3. Add the field in the view.html.php file for your views
  4. Using the JDom calls, add the field in any layouts/tmpl files - grids and item pages
  5. Add the field in the XML file for your admin forms ***EDIT : you won't need to do this in COOK 1.5 if my memory serves me correctly as it doesn't use JForm fields. I believe fields in this version are instantiated with JDom calls and will therefore need to be replaced as in step 4
Naturally, you need to do this for front and back-end files.

**********ADD*************
Alternatively or in fact, just as a safety copy, you could add the field in COOK builder (including all of the views/layouts you need it in);
  1. Download
  2. Unzip to a local directory
  3. Search the directory for all instances of your newly added field name (so make it unique if you are to do this)
  4. Open all of the files containing found instances in your original, customised component
  5. Copy all lines containing found instances of your field to the original counterpart
  6. Save and close
*****************************

Hope I haven't missed anything!

Good luck,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 01 Nov 2012 09:07 by JoomGuy. Reason: changed info specific to version 1.5
The administrator has disabled public write access.
Time to create page: 0.105 seconds

Get Started