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.076 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started