In magento if we are required to create a simple slider of products which are recently Added for say between from previous month to the current month.
Lets see how we can create it :
1. Create a module with namespace and module.
2. Then Create a file config.xml in etc folder in our module.
3. After that create a block file Addedslider.php in Block folder in our module.
3. finally create a Helper with the file Data.php.
Now, in our config.xml file at the path Namespace/Module/etc/config.xml write the below code in it :
In the above code we are loading the products which are recently added for this we first took the dates between previous month to the current month date.
then we wrote the query to fetch products which have field values 'created_at' between these two dates and returned the products array.
Now at the path design/frontend/yourtheme/layout create your layout file addedslider.xml with the below code.
in the above we are calling our own block in the home page for that we have defined the block between <cms_index_index> tag.
Now the thing is we have to design the slider in our block at /design/frontend/yourtheme/template/addedslider/addedslider.phtml
In the above code we are using class="slideshow-container" in the div before ul tag and class class="slideshow" in the ul tag, these two classes "slideshow-container" and "slideshow" are to use magento default slider.
In that way we can define our own slider by changing the block file query to fetch the products according to our requirement.