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

TOPIC:

Example of Module from Component 29 Jun 2013 12:10 #7750

  • Stordia
  • Stordia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 47
  • Thank you received: 2
Hello coders,

Please provide some examples of [How to create a Module] from J-Cook Component.

What are the first steps for this ?
What files are required to be included ?

Thank you in advance...

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

Example of Module from Component 29 Jun 2013 12:24 #7752

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Let's say your component is called 'Awesome'
define('JPATH_ADMIN_AWESOME', JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_awesome');
@require_once(JPATH_ADMIN_AWESOME.DS.'helpers'.DS.'loader.php');

This is the minimalist code to include your component classes where you want.
Then the best is to check if the component exists, and do not execute anything if the component is missing.

Note : DS must be defined. You can use DIRECTORY_SEPARATOR instead.
Once your component loaded, DS will be defined.

Also : since and thanks to JLoader, when you include these lines, almost nothing is loaded in memory until you start to effectively instance your classes.
A jewel ...
Coding is now a piece of cake
The following user(s) said Thank You: Stordia

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

Last edit: by admin.

Example of Module from Component 29 Jun 2013 18:38 #7753

  • Stordia
  • Stordia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 47
  • Thank you received: 2
Dear Admin,

Thank you for the information,

We need a complete [How to] example from one J-Cook Component View to show inside a Module.

Can you or anybody help with this ?

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

Example of Module from Component 30 Jun 2013 18:35 #7774

Thanks Admin..

It works great except for the way to access image.While using below to show the image.

<?php echo JDom::_('html.fly.file', array(
'attrs' => array('center','fit','format:png'),
'dataKey' => 'icon',
'dataObject' => $row,
'height' => 26,
'indirect' => true,
'root' => '[DIR_XXXXXCATEGORIES_IMAGE]',
'route' => array('view' => 'xxxxcontent','layout' => 'contentd','filter_category_id' => $row->id),
'width' => 26
));?>

Class ContentImages not found
Notice: Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/xxxx/administrator/components/com_xxxxx/dom/html/fly/file/image.php on line 74


Regards
Vivek

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

Example of Module from Component 24 Jul 2013 21:10 #10569

  • Stordia
  • Stordia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 47
  • Thank you received: 2
As i m getting the text fields nicely i have the same error as vivek when i try to get images...

Is there something we can do about this error ?

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

Example of Module from Component 25 Jul 2013 06:52 #10574

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Interresting. I will have a look.
Class ContentImages not found
This is not a component Class.

Moved in tickets.
Coding is now a piece of cake
The following user(s) said Thank You: Stordia

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

Example of Module from Component 28 Jul 2013 13:24 #10615

  • Stordia
  • Stordia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 47
  • Thank you received: 2
Any news with the fix for the Photos ?

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

Example of Module from Component 12 Aug 2013 14:13 #10769

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Coding is now a piece of cake

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

  • Page:
  • 1
Time to create page: 0.099 seconds
Je suis vraiment impressionné par la puissance de COOK et encore plus admiratif de ton travail. A ce jour je crois que c'est ce que j'ai vu de plus abouti dans le domaine de la conception d'extension pour Joomla!
felichon (Forum)  

Get Started