Welcome, Guest
Username: Password: Remember me

TOPIC: Where to place custom code?

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

  • jcbenton
  • jcbenton's Avatar
  • Offline
  • Premium Member
  • Posts: 125
  • Thank you received: 9
  • Karma: 3
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
The administrator has disabled public write access.

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

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
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 administrator has disabled public write access.
The following user(s) said Thank You: admin

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

  • jcbenton
  • jcbenton's Avatar
  • Offline
  • Premium Member
  • Posts: 125
  • Thank you received: 9
  • Karma: 3
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
The administrator has disabled public write access.

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

  • jcbenton
  • jcbenton's Avatar
  • Offline
  • Premium Member
  • Posts: 125
  • Thank you received: 9
  • Karma: 3
I think I got it :)

Thanks.
--
Jerry Benton
The administrator has disabled public write access.
Time to create page: 0.065 seconds

Get Started