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.110 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started