Keyword

K2+Joomfish: Translate image?

  • Mychol Scully
  • Mychol Scully's Avatar Topic Author
  • Offline
  • New Member
More
14 years 9 months ago #76808 by Mychol Scully
K2+Joomfish: Translate image? was created by Mychol Scully
In a standard Joomla+Joomfish installation, when translating an article, there is the option to upload a different image for the translation (e.g. French packaging vs. English packaging).

When translating K2 items, I do not see an option to provide a translated image to the item. Have I turned off a setting somewhere or is this standard Joomfish feature not available when working with K2?

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

  • Antonio
  • Antonio's Avatar
  • Offline
  • New Member
  • Stai Hungry, Stay Foolish!
More
10 years 4 months ago #76809 by Antonio
Replied by Antonio on topic Re: K2+Joomfish: Translate image?
I've found a possible solution. Maybe it's quite a trick, but it works.

Since K2 doesn't store the path to the image into the database, I've used other fields that are stored. In particular, I've used the image_credits field.

In that field I insert the path to the image (/images/myimage.jpg) that I've uploaded on the server via ftp or via any other means that allow you to upload a picture into the image folder.

Now I've made some minor modifications into the template overrides of the item, adding an else branch to the if that manage the image
    <?php else: 
    if(!empty($this->item->image_credits)): ?>
        <figure class="itemImageBlock">
	<a class="itemImage modal" rel="{handler: 'image'}" href="<?php echo $this->item->image_credits; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>"> 
        <img src="<?php echo $this->item->image_credits; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:100%; height:auto;" />
	</a>
        </figure>
    <?php endif; ?>
That's it. Now I can "translate" the image using Joomfish

Deploying optimal ecommerce solutions at www.ideacommerce.it

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


Powered by Kunena Forum