Publish on Magento

There are two codes, that you can use to publish your slider in Magento, the widget code, which you can use in your pages, static blocks and the xml code, which you can use in your layout xml files.


You can either copy the widget code go to your Page or Static Block, switch your editor with the Show/Hide Editor to put code in it, and paste the code, or just click on the Insert Widget image.

Then you can select your slider in the dropdown list.

But if you would like to have your slider in a different position in your template, then you could put the slider into a Static Block, and use this code with your block identifier in the template’s phtml file:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>

Magento 1.9.2 has a problem with block caching, so you might want to use this instead, if you are using that version, and you have cache on your website enabled:

<?php echo $this->getLayout()->createBlock('cms/block')->setCacheLifetime(null)->setBlockId('block_identifier')->toHtml(); ?>

To find out which phtml file is loading there you should go to the System Configuration

Advanced → Developer

Pick your store in the top left

Turn on the Template Path Hints, and the Add Block Names To Hints

 and you should see in your frontend, which part of your website is created by which file, and there will be the hints for the blocks too, if you would like to use XML code instead. 

The files of your template are here in this path: app/design/frontend/design_package/theme_variation

XML code

If you want to have your slider in a different place on your template, and not in the text content of a page, and you have some XML knowledge, then you could use this. If you have the reference name, where you would like to put your slider, then you can either put the new block into your CMS → Pages → into one of your pages

or into the Catalog → Manage Products → one of your products,

Catalog → Manage Categories → one of your categories

or the xml file of your template, which is in the app/design/frontend/design_package/theme_variation/layout folder, or into the local.xml file at the same folder. If you don’t have a local.xml file, you can create one, and that will be automatically added to your template. If you put this code into the local.xml file, then it will put the slider with the id 7 into the left position of your template (if you have that position):

<?xml version="1.0"?>
<layout version="0.1.0">
    <reference name="left">
      <block type="nextendsmartslider2/slider" name="smartslider7">
        <action method="setData">

If you don’t know the name of the position, then turn on the hints for your template, as it is written in here and that could help you find out.