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

TOPIC:

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

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.

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

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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
The following user(s) said Thank You: jonathanbell

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

Last edit: by admin.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

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

  • Page:
  • 1
Time to create page: 0.055 seconds

Hi All just wanted to add one more "thank you" voice to all those who discovered the value of this amazing application. The website I was working on went to production few days ago and I do not want to even try to imagine what would it take to build it without j-cook. So - endless thanks keep it running and evolving I believe it deserves to be the core tool for any joomla application! Thanks!
Michael (bmk028 - Forum)  

Get Started