Welcome, Guest
Username: Password: Remember me

TOPIC: Adding fields after download and custom code added

Adding fields after download and custom code added 04 Mar 2014 13:35 #12276

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
So I keep getting requests from clients to add fields to the components I create for them after I have finished the component (e.g. constructed in j-cook, downloaded and all my custom code added to it). Which leaves me in the predicament of having to spend a lot of extra time rebuilding the component in cook (e.g. adding the extra field), downloading the component and adding my custom code back into it.

So my question is "does anyone have a solution for adding fields to a component after it is finished and potentially live on a site without having to go back into j-cook rebuilding and re-adding my custom code?"

I understand this is basically what j-cook is created to do (take away the need to build components by hand) but it just ends up being an extra long process to add one field to an already finished component.

Any advice greatly welcomed.

Thanks Cefnllys
The administrator has disabled public write access.

Adding fields after download and custom code added 05 Mar 2014 17:07 #12279

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
I do this on a regular basis and generally speaking, the custom code in my forked files work fine and all I do is copy the fork directory to the updated project. Then again, maybe I'm not doing the sort of customization that you are so I'm curious as to what it is that causes the extra work for you?

Dave
The administrator has disabled public write access.

Adding fields after download and custom code added 06 Mar 2014 12:28 #12281

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
1. Add fields in database structure.
2. Add these fields in the concerned SQL SELECT queries (ITEM + LIST) > prepareQuery() in models
3. Add those fields in the concerned forms XML files ( for EDIT)
4. Instance these new datas in your views (Fly, lists, etc...) (for VIEW)
Coding is now a piece of cake
The administrator has disabled public write access.

Adding fields after download and custom code added 07 Mar 2014 12:54 #12286

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
@dyoungers: Thanks for your interest, I often have to put extra where clauses in my list views be it by user or by date (so a user only see's their items or items get filtered by the current date and I have to put this code in the models) also when I set up my views I often have parameters in the component options to turn of the display of things as and when needed in the views, thus my views have a small amount of custom code be it PHP or Javacsript and also the config.xml. There are probably better way of doing this but I am no expert in the ways of Joomla and what knowledge I do have is cobbled together from the joomla documents and the forums here on j-cook

@admin: Thanks very much I will have a go with this method shortly hopefully I wont make too much of a mess of it.

All help very appreciated.

Cheers,
Cefnllys
The administrator has disabled public write access.

Adding fields after download and custom code added 09 Mar 2014 00:23 #12287

  • dyoungers
  • dyoungers's Avatar
  • Offline
  • Premium Member
  • Posts: 123
  • Thank you received: 16
  • Karma: 0
We all look at things differently and we do what makes sense to each of us. For what its worth, to handle those types of modifications I add the filters to my list view and then fork the views to take the filters off the view and set them explicitly in the code so I don't have to worry about the models. It just seems easier but thats me :-)
The administrator has disabled public write access.
Time to create page: 0.077 seconds

Get Started