Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Where to place custom code? 01 Sep 2013 18:03 #10936

I have a question regarding customizing the code when an item is created. In short, where to put it?


com_thing
> admin
>> models
>>> foo.php
>>> fooitem.php

So I would assume that I put my custom code here when creating a NEW item, but where?

com_thing
> admin
>> fork
>>> models
>>> fooitem.php

Is this the right file? If so, under what function?

prepareQuery() ?
prepareTable() ?

I have been looking at each of them and testing, but I can't seem to get it right.
--
Jerry Benton

Please Log in or Create an account to join the conversation.

Where to place custom code? 01 Sep 2013 18:12 #10937

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Yes, in the fork folder.
Just copy the function you want to change into the fork/models/the_name_of_the_file.php
depends on what you want to do.
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Where to place custom code? 01 Sep 2013 18:19 #10938

So the "item" file? (The default j-cook uses when creating an item view.)

I can't seem to get my code to fire off when creating a new item. I have even tried just a simple "echo 'HIT';" when the code block is encountered.
--
Jerry Benton

Please Log in or Create an account to join the conversation.

Where to place custom code? 01 Sep 2013 18:29 #10939

I think I got it :)

Thanks.
--
Jerry Benton

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.084 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started