Banner 7 Magento - Problem with the link

0

I'm having a little problem with the rotating banner on the following website: link .

As you can see, the second slide has a clickable link in the image with the text: "Learn more". But I'm trying to get the whole slide image to be linked. So just click on the image to go to the page of the link in question. But without success.

Below the Banner 7 code:

<?php 
/******************************************************
 * Website: http://www.plazathemes.com
*******************************************************/
?> 
<?php if($this->getConfig('enabled')){ ?>     <!-- start enable -->
    <?php $cur_store = Mage::app()->getStore()->getId() ?>
    <div class="ma-banner7-container">
        <!--<div class="container">-->
            <div class="flexslider ma-nivoslider">
        <div class="ma-loading"></div>
        <div id="ma-inivoslider" class="slides">

                <?php
                    // Get data banner
                    $slide = $this->getDataBanner7();
                    $path = Mage::getBaseUrl('media');                  
                    $qty_Item = $this->getConfig('qty_item');
                    if ($this->getConfig('auto')) { $auto = 'true'; } else { $auto = 'false'; }
                    /* Get max item & qty item */
                    if ($qty_Item > count($slide)) {
                        $qty_Item = count($slide);
                    }
                ?>
                <?php
                    $i = 1;
                    foreach($slide as $s) {
                        if($i <= $qty_Item) {
                            //Get images slide show
                            $st1 = $s['image'];
                            $p1 = strpos($st1,'banner7');
                            $st2 = substr($st1,$p1+7);
                            $p2 = strpos($st2,'"');
                            $imag = substr($st2,0,$p2);
                    ?>
                    <img style="display: none;" src="<?php echo $path.'magentothem/banner7'.$imag;?>" alt="" title="#banner7-caption<?php echo $i; ?>"  />
                    <?php $i++; ?>
                <?php
                        }//end if
                    } // end foreach
                ?>
        </div>
                <?php
                    $i = 1;
                    foreach($slide as $s) { ?>

                            <div id="banner7-caption<?php echo $i; ?>" class="banner7-caption nivo-html-caption nivo-caption">
                                <div class="banner7-title">
                                    <h3><?php echo $this->__($s['title']) ?></h3>
                                </div>
                                <div class="banner7-des">
                                    <?php echo $this->__($s['description']) ?>
                                </div>
                                <?php if( $s['link'] ) { ?>
                                    <div class="banner7-readmore">
                                        <a href="<?php echo $s['link']?>" title="<?php echo $this->__('Saiba mais') ?>"><?php echo $this->__('Saiba mais') ?></a>   
                                    </div>
                                <?php } ?>
                            </div>                      
                <?php
                    $i++;
                    }
                ?>
        <script type="text/javascript">
            $jq(window).load(function() {
                $jq('#ma-inivoslider').nivoSlider({
                    effect: '<?php echo $this->getConfig('animation') ?>',
                    slices: 15,
                    boxCols: 8,
                    boxRows: 4,
                    animSpeed: <?php echo $this->getConfig('interval') ?>,
                    pauseTime: <?php echo $this->getConfig('speed') ?>,
                    startSlide: 0,
                    <?php if (!$this->getConfig('nav_ctrl')) { ?>
                    controlNav: false,
                    <?php } ?>
                    <?php if (!$this->getConfig('next_back')) { ?>
                    directionNav: false,
                    <?php } ?>
                    controlNavThumbs: false,
                    pauseOnHover: true,
                    manualAdvance: false,
                    prevText: 'Prev',
                    nextText: 'Next',
                    afterLoad: function(){
                        $jq('.ma-loading').css("display","none");
                        //$jq('.banner7-title, .banner7-des, .banner7-readmore').css("left","100px") ;
                        },     
                    beforeChange: function(){ 
                        $jq('.banner7-title, .banner7-des').css("left","-2000px" );
                        $jq('.banner7-readmore').css("left","-2000px"); 
                    }, 
                    afterChange: function(){ 
                        $jq('.banner7-title, .banner7-des, .banner7-readmore').css("left","40px") 
                    }
                });
            });
        </script>
    </div>
        <!--</div>-->
    </div>
<?php } ?> <!-- end enable -->
    
asked by anonymous 09.11.2018 / 14:09

1 answer

0

great Felipe,

We can see two blocks of code that start with foreach

The first one is to load the images, using the code:

<img style="display: none;" src="<?php echo $path.'magentothem/banner7'.$imag;?>" alt="" title="#banner7-caption<?php echo $i; ?>"  />

the second is to display the "learn more" button. so in this first foreach, you will change the above line by:

<?php if( $s['link'] ) { ?>
    <a href="<?php echo $s['link']?>">
        <img style="display: none;" src="<?php echo $path.'magentothem/banner7'.$imag;?>" alt="" title="#banner7-caption<?php echo $i; ?>"  />
    </a>
<?php } else { ?>
    <img style="display: none;" src="<?php echo $path.'magentothem/banner7'.$imag;?>" alt="" title="#banner7-caption<?php echo $i; ?>"  />
<?php } ?>

I did not test, but I imagine it should work .. if it does not work, it will be for some small detail to be reviewed .. but the code is practically there. :)

success there.

    
18.11.2018 / 23:05