1

I have installed the free extension Banner Slider from magestore, and it works great so far.

I positioned the slider via the backend in the menu-bottom position.

This position is exactly where i want it, but the problem is, here it shows on every page rather then just the home page like i want it too.

Can any of you guys point me in the right direction?

I have tried various positions to no avail. I have added the line of code to the cms home page content, but this is an incorrect position because the left column shows next to the banner rather then beneath it.

I have also tried using the line of XML code they provided to directly hardcode it in. I put this line of code in the page.xml file in between breadcrumbs and the header blocks, and then set the slider position to custom. but again this has not worked.

Any ideas appreciated thanks.

1
  • If you don't know what you are doing, you can break a lot of things. Don't edit the page.xml unless you copied it in your own theme and if you ask me, I still don't like this method, I prefer a local.xml. If you only want the slider on the homepage you have to use the correct layout handle. I think cms_index_defaultindex should do. Aug 29, 2013 at 10:48

1 Answer 1

0

Just to elaborate on Fabian's comment in case you are not familiar with working with local.xml. You can read up on it here -> http://www.classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout

Rather than modifying any of the core layout files you make your own changes to a local.xml xml file in the same directory (ie app/design/frontend/[your_package]/[your_theme]/layout/ ). That layout file will be loaded last and will override any of the core files, thereby allowing you to modify a core layout file without touching it.

You xml would be put inside the handle cms_index_index like so;

<?xml version="1.0" encoding="UTF-8"?>
<layout>

    <cms_index_index>

            <reference name="content">

                 <block type="bannerslider/default" name="bannerslider.bannerslider" template="bannerslider/bannerslider.phtml">
                     <action method="setBannersliderId"><bannerslider_id>1</bannerslider_id></action>
                 </block>

            </reference>


    </cms_index_index>

</layout>
8
  • I have just created the local.xml in that directory and inputted this code [code]<block type="bannerslider/default" name="bannerslider.bannerslider" template="bannerslider/bannerslider.phtml"> <action method="setBannersliderId"><bannerslider_id>1</bannerslider_id></action> </block>[/code]
    – Tom Burman
    Aug 29, 2013 at 11:46
  • but still no avail! any other ideas? thanks
    – Tom Burman
    Aug 29, 2013 at 11:46
  • You would need to put that inside a block reference like <reference name="content"></reference> the same reference as you used in page.xml
    – McNab
    Aug 29, 2013 at 12:31
  • Ok i think i need to understand the xml of magento a bit more, so i will look into it, then try your method, thanks!
    – Tom Burman
    Aug 29, 2013 at 12:48
  • Maybe I've confused things by omitting that from the original code. Have updated!
    – McNab
    Aug 29, 2013 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.