What is the best way to incorporate two banners on the Magento homepage alongside my flexslider?

I recently made the switch from using a camera.js slider on my website to a Flexslider. The reason for this change was that I couldn't make the camera.js slider clickable, and I wanted to eliminate the 'Click here' button. However, now that I have integrated the Flexslider into my site, I am facing challenges in getting back two banners that used to be displayed next to the camera.js slider.

Upon visiting my homepage, you can observe that the banners are not appearing on the right side of the slider as intended but are positioned incorrectly:

https://i.sstatic.net/yESl9.jpg

My goal is to have two banners sized 381 x 219 displayed on the right of the slider, stacked one above the other.

Below is the code snippet:

<div class="container">
<div class="row">
<div class="span12">
<script type="text/javascript">// <![CDATA[
jQuery.noConflict();
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="25"}}
</script>
<ul class="banner-block-right">
<li><a href="{{store url='nieuwe-producten'}}"> <img src="{{skin url='images/media/banners-8.png'}}" alt="" /> </a></li>
<li><a href="{{store url='klantenservice'}}"> <img src="{{skin url='images/media/banners-7.png'}}" alt="" /> </a></li>
</ul>
</div>
</div>
</div>

To provide some context:

  • The code snippet: script type="text/javascript">// etc was utilized due to issues with the navigation bar after integrating the new slider.

Additionally, I placed the slider within a widget for ease of use.

Therefore, my question surrounds the necessary adjustments in the code to ensure the two small banners appear alongside the Flexslider.

On a side note, when I implemented the script to fix my navigation bar, it caused the default Magento pricing layout to reappear. It seemed like a trade-off between functionality of the navigation bar and correct layout of Magento pricing. Any suggestions for resolving this conflict would be appreciated. Thank you!

EDIT: Showing the CSS code for the Flexslider

/*
 * jQuery FlexSlider v2.0
 * http://www.woothemes.com/flexslider/
 *
 * Copyright 2012 WooThemes
 * Free to use under the GPLv2 license.
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Contributing author: Tyler Smith (@mbmufffin)
 */


/* Browser Resets */
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus  {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;} 

/* FlexSlider Necessary Styles
*********************************/ 
.flexslider {max-width: 700px; margin: -20; padding: 0;}
.flexslider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */

.flexslider .slides img { 
  display: block;
  max-width: 100%; height: auto; margin: - auto;
}

Answer №1

It all comes down to your CSS setup.

Here are a few things to consider:

  • Make sure your banner-block-right class doesn't have a 'clear' style rule applied to it. The 'clear' property clears floats.
  • Check if both the slider and the banner-block-right elements have a float rule.
  • Ensure that the slider isn't too wide causing layout issues.

If these tips don't solve the issue, feel free to share relevant sections of your CSS code for further assistance.

Update after reviewing the webpage:

The problem seems to be with the nesting of your ul element within the div row. When inspecting your webpage, I noticed the following structure:

<div class="container">
    <div class="row">
        <div class="span12">
            <script type="text/javascript">
            <script src="http://www.site.nl/js/magestore/bannerslider/jquery.flexslider.js">
            <link media="all" href="http://www.site.nl/skin/frontend/base/default/css/magestore/bannerslider/flexslider.css" type="text/css" rel="stylesheet">
            <script type="text/javascript">
            <div class="flexslider flexslider-7-1">
            <script type="text/javascript">
        </div>
    </div>
    <script type="text/javascript">
</div>
<ul class="banner-block-right">

It appears that your widget is closing the .container and .row divs prematurely. The template you're using may have excessive closing tags at the end causing this issue.

Answer №2

Hooray! That really solved my problem! Everything is now just the way it should be, and I couldn't be happier!

I decided to remove the widget and instead paste the code into the CMS after the three closing divs. Now everything looks great on all devices! 😊

The only issue remaining is that the script used to maintain dropdown functionality is causing some layout changes in the pricing section, reverting it back to the default Magento style. Any tips on how to resolve this?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Sliding Toggle: Panel Revealed with Button Slide

Currently, I am working on implementing a jquery slide tab feature. The functionality is working fine on button click. However, I want the button to stick with the panel and slide along with it. At the moment, the button remains fixed while the panel slide ...

Accordion menu designed exclusively with JavaScript

Implementation of required menu structure: Main Menu Submenu Contacts News Photo Submenu Submenu Submenu Main Menu Main Menu Main Menu When clicking on the "Main Menu" button, a list of "Submenu" elements opens. Clicking on the "Submenu" button ope ...

The headline box is displaying CSS code instead of the content. How can this issue be resolved?

Having an issue with a WordPress template that features a blue "headline" box that I need to change the color of to #333399. I tried inspecting the element, browsing through the code, and identified the code below as what needed modification: #headline, # ...

The Firefox browser is not fully displaying the button background

Having an issue with a button that doesn't completely fill up on Firefox only. Here's the problem in action: This is how it should actually look: Not quite sure what to do. Here's the CSS styling being used: .button-panel .button { -web ...

Is it possible to have a GIF start playing when hovered over and automatically pause when the mouse is moved away?

Is there a method to create a GIF with specific functions? Beginning in a paused state on the page; Playing only when hovering over it; Stopping at the exact frame where the mouse leaves the image. Can these features be achieved without relying on JavaS ...

Ways to include a right arrow symbol for sub-child items and a downward arrow for child menu options

I have a php form that generates a drop-down menu using php mysql. The current menu is simple, but I would like to enhance it by adding a right arrow for sub-children and a down arrow for child menus using css. Unfortunately, I am unable to modify the css ...

`The search bar and search button`

On mobile, I have a search field and a button working fine. However, when typing in something and hitting "search" on the phone's keyboard, it leads to a 404 error. But clicking the "search" button works as expected. I would like to be able to hit "se ...

The styles defined in CSS do not have an impact on EJS templates that have GET route paths stacked

I have a CSS file located in the public directory and two EJS templates in the views directory. The CSS file works fine when using this route: app.get('/theresa', (req, res) => { res.render('templates/home') }) However, when I ...

VSCode is indicating a CSS error, requesting an at-rule or selector

I tried to implement a piece of CSS code I found on a website, but I'm encountering an error in this particular section .pricing-table:hover{ box-shadow: 0px 0px 19px -3px rgba(0,0,0,0.36); /*issue starts from this line*/ .pricing-table__button ...

Utilizing Isotope JS on your Wordpress website

I'm in the process of integrating the .js plugin, Isotope, into my Wordpress installation. It should be positioned at the bottom of this page: To achieve this, I am referring to an example on codepen: https://codepen.io/desandro/pen/mEinp The script ...

Center the middle item in a flexbox column arrangement

I'm working on a layout where I have three items stacked vertically within a column. My goal is to center the middle item (green) in the column and have the other items positioned around it. Here's my current setup: .flex-row { display: fl ...

How to Make Page Slide in Either Direction Based on User Click Location

Although the title of my question may not be very descriptive, I am essentially trying to implement a functionality where a page will slide right if a user clicks a link to the right of their current active link, and slide left if they click a link to the ...

Update the font URL in Bootstrap 5

I am looking to update the URL that Bootstrap uses to access fonts, as I want to host them on my server instead of relying on users to fetch them from Google with each page load. However, despite my efforts, I cannot locate the specific URLs mentioned when ...

Mastering Space Between Row Items in Bootstrap 5 Grid: A Guide to Gutters

Hello, I am currently utilizing Bootstrap 5 and making use of the grid system. My layout is divided into 2 rows - one containing text and an image, and the other row consisting of two images. While everything looks fine on a PC, the mobile view displays t ...

The Zoom CSS property seems to be experiencing some issues on the Firefox browser

After researching the issue, I discovered several solutions involving css3 transition techniques. Currently, I have been using {zoom:1.5} for all of my buttons. However, this method does not work on Firefox. When attempting to implement the transition pro ...

Enhancing a character's appearance with custom CSS styling

In my code, I want to highlight a single character throughout the page. I want the lines between each word to be a different color from the rest of the text using CSS, without having to add span tags to each one individually. Anti-virus End Point | Dis ...

Tips for arranging links in a vertical layout on a navigation bar that is compatible with every device

I'm having trouble aligning the links vertically in the center of the navigation bar, with the logo overlapping the content. Check out the HTML code below: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

The appearance of the pop-up mask is displayed at lightning speed

Check out the demo here Here is the HTML code: <div class="x"> </div> <input class="clickMe" type="button" value="ClickMe"></input> This is the JS code: $(".clickMe").click( function() { ...

adjustable text size in web view interface

When loading the following html string in a uiwebview, I am trying to set the font-size as a variable value: NSString * htmlString = [NSString stringWithFormat:@"\ <html>\ <s ...

Tips for concealing the loader once all pages have been loaded

Within the context of my website development project at , I am utilizing a script for infinite scrolling to consolidate multiple pages into one seamless scrolling experience. I am seeking a solution to hide the loader (the spinning icon) when no additiona ...