0
Welcome Guest! Login
0 items Join Now

Jogadgets:Help with displaying multi-line images titles?

    • tatelev's Avatar
    • tatelev
    • Hero Rocketeer
    • Posts: 264
    • Thanks: 1

    Jogadgets:Help with displaying multi-line images titles?

    Posted 17 years 5 months ago
    • Hi,

      i am using Jogadgets component and it´s mambot to create dynamically images with my chosen font and show that image instead of the content item title.

      This is one lovely feature, because you don´t depend on the web visitor having that font installed or not, since the image is created in the server with the font you like. It even has a cache logic, so once images have been created for visitor 1, they will be grabbed from the cache for visitor 2, hence speeding it even more. It works great except for one thing:

      The jogadgets mambot is made to display text images in only ONE row. So, if the content title is of considerable length then you´ll get only part of the image displayed.

      Hence i have modified the Jogadgets imagetitle creating function to make images that display long texts wrapping the text into multiple lines. This works in terms of the images being created, but i am not managing to show them well.

      the relevant piece of code in the mambot is:
      //Imagetitles
        if($GLOBALS['confJG']['useimgtitle']==true){
          $style= 'display:block;height:'.$GLOBALS['confJG']['imgtitle_height'];
         
          // perform the replacement
      &nbsp;  $row->title = '<div style="'.$style.';background:url(_jgfw_/image.php?text='.urlencode(strip_tags($row->title)).') no-repeat;">&nbsp;</div>';
      &nbsp;  
      &nbsp; }

      As you can see, the image created on the fly by calling the script with background:url is being displayed in a <div> that has the height set from the jogadgets config variable. This is what i meant: it´s only made to display images of one row of text, being the height of those images allways the same.

      So basically i need a way of making that <div> elastic(??) so it can display images of different heights, because for example a 2-line image title will be of double the height,etc...

      - i have tried setting the height of that div =100% (commenting the line where the height is grabbed from a jogadgets variable) but that doesn´t work. The height doesn´t turn elastic.

      - i have obsrved that in core Joomla(without Jogadget published), content titles are actually wrapped into multiple lines if the text is very long, but in this situation seems to be trickier.

      Any idea on how i could accomplish this?

      Thank you very much in advance,
      NiCo
    • tatelev's Avatar
    • tatelev
    • Hero Rocketeer
    • Posts: 264
    • Thanks: 1

    Re: Jogadgets:Help with displaying multi-line images titles?

    Posted 17 years 5 months ago
    • No ideas on how i could try to solve this? :'(

      Maybe my post too dense..

      NiCo

Time to create page: 0.034 seconds