0

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>

Edited by loudy_ca: mistake

2
Contributors
5
Replies
12
Views
3 Years
Discussion Span
Last Post by loudy_ca
0

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>
0

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

0

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.

Edited by Isaac_4

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.