Welcome, Guest
Username: Password: Remember me

TOPIC: [FAQ] JDom Images inside a module

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

  • Pantelis
  • Pantelis's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
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...
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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
Last Edit: 29 Jun 2013 12:25 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: Pantelis

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

  • Pantelis
  • Pantelis's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
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 ?
The administrator has disabled public write access.

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

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

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

  • Pantelis
  • Pantelis's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
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 ?
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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 administrator has disabled public write access.
The following user(s) said Thank You: Pantelis

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

  • Pantelis
  • Pantelis's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
Any news with the fix for the Photos ?
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.113 seconds

Get Started