Welcome, Guest
Username: Password: Remember me

TOPIC: Module to retrieve data from a jcook component

Module to retrieve data from a jcook component 21 Apr 2013 02:10 #7059

  • Maujb
  • Maujb's Avatar
  • Offline
  • Junior Member
  • Posts: 27
  • Thank you received: 2
  • Karma: 2
Hi Guys,
I managed to create a component using Jcook that works just like I wanted.
The problem now is that I need a module to retrieve the latest entries.
So I tought I could duplicate the built-in mod_articles_news and change a few references and it would work as I need.

The problem I came across is that in the 'helper.php' I am having trouble referening to my Jcook component router and models. I think the structure of the component generated by Jcook is different from the joomla2.5 built in ones.

I am not 100% but I think my problem is when rerefring to
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));

Not sure what 'Articles' and 'ContentModel' should refere to.

To be honest I am not sure what I am doing so any help will be very much appreciated.

Is there any generic module available where I could change the reference to my component? Or could someone explain to me what the 'Articles' and 'ContentModel' refere to?

I am no an expert, I am learning and my way to learn is by try and error and kind deconstructing things.

Thanks in advance.
The administrator has disabled public write access.

Re: Module to retrieve data from a jcook component 21 Apr 2013 17:39 #7063

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Hi,

if you are average user of PHP it is relatively easy job. I will try to point you.

First forget about mod_articles_news.
Second generate your new module for example by this free tool:
generator
or whatever generator you will find by yourself.

Sorry, now I will be very brief. In your new generated module find helper.php, here define sql query.
Then find default.php in tmpl folder and retrieve the data from your sql model and display them.

etc
The administrator has disabled public write access.

Re: Module to retrieve data from a jcook component 22 Apr 2013 09:46 #7064

  • Maujb
  • Maujb's Avatar
  • Offline
  • Junior Member
  • Posts: 27
  • Thank you received: 2
  • Karma: 2
Hi etc,
Thanks for your repply.
I actualy found this tutorial www.slideshare.net/vishwashgaur/simple-m...lopment-in-joomla-25
That helped me alot. Might help someone else too.


It is almost working as I need, the thing now is that the component created in j-cook creates a folder for the uploaded files and images outside the 'images' folder. I know we can change this in the component configuration and there is where lies my question.

Ok, I upload an image through the componenet I created and when I call it in the module I just did, it retrieves the image name.
How can I call, get, retrieve the upload_dir parth that was entered/saved in the component configuration screen in the module I am creating?

Thanks
Last Edit: 22 Apr 2013 10:16 by Maujb.
The administrator has disabled public write access.
Time to create page: 0.106 seconds

Get Started