Hello all,

I need help as the support team at rockettheme told me that this is out of their support area and its belong to joomla, but they were kind enough to tell me which file need to be adjusted

All I need is to make the image linkable to the article, now only the title and he read more are linked to the title. but I'm not sure how to do the image, and add the joomla php elements to it so the image also be a link to the article.

here is the extension:

http://demo.rockettheme.com/live/joomla-extensions/roksprocket/strips

Please see attached for more info.

http://i59.tinypic.com/dwujv7.png

here is the code that they told me needed to be edited:

<?php

?>
<li data-strips-item>
   <div class="sprocket-strips-item" <?php if ($item->getPrimaryImage()) :?>style="background-image: url(<?php echo $item->getPrimaryImage()->getSource(); ?>);"<?php endif; ?> data-strips-content>
      <div class="sprocket-strips-content">
         <?php if ($item->getTitle()) : ?>
         <h4 class="sprocket-strips-title" data-strips-toggler>
            <?php if ($item->getPrimaryLink()) : ?><a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>"><?php endif; ?>
               <?php echo $item->getTitle();?>
            <?php if ($item->getPrimaryLink()) : ?></a><?php endif; ?>
         </h4>
         <?php endif; ?>
         <?php if ($item->getText()) :?>
            <span class="sprocket-strips-text">
               <?php echo $item->getText(); ?>
            </span>
         <?php endif; ?>
         <?php if ($item->getPrimaryLink()) : ?>
         <a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>
         <?php endif; ?>
      </div>
   </div>
</li>

It looks like you'll sort of have to rebuild that section a bit, something like this might work... Basically we're removing the image from the background of that first element (assuming this is the actual image you want) and moving it into a box that can have an anchor tag wrapped around it, if one is needed (if getPrimaryLink() returns true).

<style>
.custom-box {
    float: left;
    margin-right: 10px;
}
</style>
<li data-strips-item>
    <!-- removed image from background -->
   <div class="sprocket-strips-item" data-strips-content>
      <div class="sprocket-strips-content">
      <!-- added image as linkable img tag -->
         <?php if ($item->getPrimaryImage()) :?>
             <div class="custom-box">
             <?php if ($item->getPrimaryLink()) : ?><a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>"><?php endif; ?>
             <img src="style="<?php echo url(<?php $item->getPrimaryImage()->getSource(); ?>);" />
             <?php if ($item->getPrimaryLink()) : ?></a><?php endif; ?>
             </div>
         <?php endif; ?>
         <!-- end of changes -->
         <?php if ($item->getTitle()) : ?>
         <h4 class="sprocket-strips-title" data-strips-toggler>
            <?php if ($item->getPrimaryLink()) : ?><a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>"><?php endif; ?>
               <?php echo $item->getTitle();?>
            <?php if ($item->getPrimaryLink()) : ?></a><?php endif; ?>
         </h4>
         <?php endif; ?>
         <?php if ($item->getText()) :?>
            <span class="sprocket-strips-text">
               <?php echo $item->getText(); ?>
            </span>
         <?php endif; ?>
         <?php if ($item->getPrimaryLink()) : ?>
         <a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="readon"><span><?php rc_e('READ_MORE'); ?></span></a>
         <?php endif; ?>
      </div>
   </div>
</li>

Hi Issac4,

Thank you so much for the help, I placed the code but I'm getting this error:
Parse error: syntax error, unexpected '<', expecting ')' in /mypath/themes/default/item.php on line 15

---------
Please help

Oops, replace that line with

<img src="<?php echo $item->getPrimaryImage()->getSource(); ?>" />

Really not sure if this all will work, I don't use Joomla specifically.

Thank you, there no more error, but still the image not linkable. :( but anyway thank you so much Isaac4 for you help

Hello, any one can offer me a hand. Thank you Guys.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.