Welcome, Guest
Username: Password: Remember me

TOPIC: Can you change the folder Image on Fly points to?

Can you change the folder Image on Fly points to? 26 Jun 2016 07:03 #14090

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
I currently have a fly form for showing a printable form. I have company details in another component and want to use the image in this component. Is there a way to get the image to be loaded from another component, currently this forces the image from the current components sub file directory company_details_logo : I am wanting it to get from the same folder name in another components file directory..

<div class="controls">
			<?php echo JDom::_('html.fly.file', array(
				'dataKey' => '_company_logo',
				'dataObject' => $this->item,
				'height' => 'auto',
				'indirect' => FALSE,
				'root' => '[DIR_COMPANYDETAILS_LOGO]',
				'width' => 'auto'
			));?>
		</div>

Any help appreciated.
The administrator has disabled public write access.

Can you change the folder Image on Fly points to? 26 Jun 2016 10:06 #14091

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Happy Sunday,
You are lucky I am working every day for this summer sprint.

All you have to do is to add the 'extension' parameter in JDom
    'extension' => 'com_mycomponent'
But you must be sure that this component is loaded before, because JDom will NOT load it for you.

But as I saw, it was not working, so you need to add 2 line in JDom to make it working:
jdom/dom.php

FROM LINE 423:
public function getExtension()
{

// ADD THIS
	if ($extension = $this->getOption('extension'))
		return $extension;
//END


	$dom = JDom::getInstance();
	if ($extension = $dom->get('extension'))
		return $extension;


	$jinput = new JInput;
	$extension = $jinput->get('option', null, 'CMD');

	if ($extension)
		$dom->set('extension', $extension);


	return $extension;
}

I will fix it for the next JDom version. Thank you for this hint.
Because at the moment is was working only for modules, but once it has been loaded from a component, the extension parameter was not read afterwards.
Now with this fix, the parameter overload the static value, and will not interfer with other calls.

Hope it helps you.
Coding is now a piece of cake
Last Edit: 26 Jun 2016 10:07 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: jonathanbell

Can you change the folder Image on Fly points to? 27 Jun 2016 10:28 #14093

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Fixed.

By the way, the files are just 100% Rewritten, so check out the new helper class. It is a brillant rewrite.

Check also your forks:
www.j-cook.pro/index.php/docs/versions/226-2-9
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.107 seconds

Get Started