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

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started