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

TOPIC:

alt and title for images 03 Aug 2014 12:45 #12566

in my component i've an image called "logo"
in component builder I selected to use Item title (field "Nazwa firmy") as an image title and image alt



but unfortunately in may component frontend an alt and title attribut are missing,

code generatet in frontend
<div class="controls">
    <div style="width:px;height:px; overflow:hidden;display:inline-block;" class="img-zone">
        <img style="" src="/sandbox/cms25/index.php?option=com_demo11407&amp;task=file&amp;size=195x145&amp;attrs=center,format:png&amp;path=[DIR_FIRMY_LOGO]/alf-2.png">
    </div>	
</div>

and the size of img-zone div i empty - the inline style

How can I solve this problem?

I use Joomla 2.5

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

Last edit: by VentoStudio.

alt and title for images 05 Aug 2014 14:27 #12573

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I have fixed this.
But for the moment it is not in the builder.
You might upgrade manually JDom in your libraries folder
libraries/jdom/html/fly/file/image.php

Here is the fixed file of JDom :
github.com/Cook-Self-Service/JDom/blob/m...l/fly/file/image.php

Hope it helps...
Coding is now a piece of cake

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

alt and title for images 05 Aug 2014 17:06 #12576

I managed to solve it in another way,

This is the original code from the generator:
<?php echo JDom::_('html.fly.file', array(
	'altKey' => 'alias',
	'attrs' => array('center','format:png'),
	'dataKey' => 'logo',
	'dataObject' => $row,
	'height' => 145,
	'indirect' => true,
	'root' => '[DIR_FIRMY_LOGO]',
	'route' => array('view' => 'firma','layout' => 'wizytowka','cid[]' => $row->id),
	'titleKey' => 'nazwa_firmy',
	'tooltip' => true,
	'width' => 195
));?>


and after modification:
<?php echo JDom::_('html.fly.file', array(
	'alt' => 'alias',
	'attrs' => array('center','format:png'),
	'dataKey' => 'logo',
	'dataObject' => $row,
	'height' => 145,
	'indirect' => true,
	'root' => '[DIR_FIRMY_LOGO]',
	'route' => array('view' => 'firma','layout' => 'wizytowka','cid[]' => $row->id),
	'title' => 'nazwa_firmy',
	'tooltip' => true,
	'width' => 195
));?>

Here is what has been modified:

'altKey' => 'alias',
to
'alt' => 'alias',

and
'titleKey' => 'nazwa_firmy',
to
'title' => 'nazwa_firmy',

and it also works :-)

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

Last edit: by VentoStudio.

alt and title for images 05 Aug 2014 19:59 #12577

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is strange.

You should eventualy can use :
<?php echo JDom::_('html.fly.file', array(
	'alt' => $row->alias,
	'title' => $row->nazwa_firmy,
));?>

But it is strange that it works as you say...

Note that the extra feature using the key, is that you can concat easily. For instance:
<?php echo JDom::_('html.fly.file', array(
	'altKey' => '{nazwa_firmy} - {alias}',
	'titleKey' => '{nazwa_firmy} - {alias}',
));?>
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.378 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