2

See what is happening: enter image description here It is a slider so it should actually be just size of a image and not one after another.

Here is my code of home content:

Home Page



{{block type=\\\’core/template\\\’ template=\\\’pagayo/home.phtml\\\’}} {{block type="cms/block" block_id="pt001-home-slider1"}}

{{block type=\\\’core/template\\\’ template=\\\’pagayo/home.phtml\\\’}} {{block type="cms/block" block_id="pt001-home-slider2"}}

{{block type=\\\’core/template\\\’ template=\\\’pagayo/home.phtml\\\’}} {{block type="cms/block" block_id="pt001-home-slider3"}}

Here is Design code:

{{block type="cms/block" block_id="pt001-home-slider1"}}
<reference name=\\\"content\\\"> 
<block type=\\\"catalog/product_list\\\" name=\\\"featured\\\" template=\\\"catalog/product/list.phtml\\\"> 
<action method=\\\"setCategoryId\\\"><category_id>pt001-home-slider1</category_id></action> 
<action method=\\\"setColumnCount\\\"><count>5</count></action> 
</block> 
</reference>
{{block type="cms/block" block_id="pt001-home-slider2"}}
<reference name=\\\"content\\\"> 
<block type=\\\"catalog/product_list\\\" name=\\\"featured\\\" template=\\\"catalog/product/list.phtml\\\"> 
<action method=\\\"setCategoryId\\\"><category_id>pt001-home-slider2</category_id></action> 
<action method=\\\"setColumnCount\\\"><count>5</count></action> 
</block> 
</reference>
{{block type="cms/block" block_id="pt001-home-slider3"}}
<reference name=\\\"content\\\"> 
<block type=\\\"catalog/product_list\\\" name=\\\"featured\\\" template=\\\"catalog/product/list.phtml\\\"> 
<action method=\\\"setCategoryId\\\"><category_id>pt001-home-slider3</category_id></action> 
<action method=\\\"setColumnCount\\\"><count>5</count></action> 
</block> 
</reference>

What am i doing wrong?

  • i think you have called the slider thrice, instead of calling one slider with 3 images. – Helphin Mar 5 '14 at 5:12
  • @Helphin how to include 3 images in one and do it? – Daksh Shah Mar 5 '14 at 5:15
  • just follow the answer – Helphin Mar 5 '14 at 6:08
2

just call,

  {{block type="core/template" template="pagayo/home.phtml"}}

in your page,

this home.phtml calls your CMS/Blocks thrice, so the three images calls in this slider, check the code inside the class scroller,

<div class="homepage">

    <div id="slider">
        <div class="slidercontrolwr-left">
            <div class="slidercontrol">
                <a href="#" class="aprev" title="Previous" onClick="my_glider.previous();return false;">Previous</a>
            </div>
        </div>
        <div class="slidercontrolwr-right">
            <div class="slidercontrol">
                <a href="#" class="anext" title="Next" onClick="my_glider.next();return false">next</a>
            </div>  
        </div>
        <div class="scroller">
            <div class="content">
                <div class="section" id="section1">
                    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt001-home-slider1')->toHtml() ?>
                </div>
                <div class="section" id="section2">
                    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt001-home-slider2')->toHtml() ?>
                </div>
                <div class="section" id="section3">
                    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt001-home-slider3')->toHtml() ?>
                </div>
            </div>
        </div>
    </div>
    <script src="<?php echo $this->getSkinUrl('js/') ?>glider.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8">
        var my_glider = new Glider('slider', {duration:0.5, autoGlide: true, frequency: 4, initialSection: 'section1'});
    </script>

    <div class="home-box1">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt003-home-box1')->toHtml() ?>
    </div>
    <div class="home-box2">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt003-home-box2')->toHtml() ?>
    </div>
    <div class="home-box3">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt003-home-box3')->toHtml() ?>
    </div>
    <div class="home-box4">
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('pt003-home-box4')->toHtml() ?>
    </div>
    <div class="clearer"></div>

</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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