Hi,
Every template needs a corresponding *.php file.
i.e. You want to create a page that shows Products
class PageProduct extends Page{
}
class PageProduct_Controller extends Page_Controller{
}
Then you need to create a corresponding template file called PageProduct.ss.
Same thing with inheritance. You can create children for a page by creating a function, adding it to the allowed actions and creating a *.ss file with the name PageProduct_functionName.ss. As soon as you redirect to that function it will call that child page.
Furthermore, you should only flush=all to clear cached images. Any time you add, or include a template, and only then, do you have to flush ON THAT PAGE (important) by doing /url/products?flush or /url/viewProduct?flush (the 1 is no longer required).
One more thing to note, it is very important that you put all the template (.ss) files in the layout folder. The way Silverstripe is built, it always loads the Page.ss from themes, and where the $Layout is called in that page, it will look for a corresponding *.ss file in the layout folder. So if PageProduct was loaded, it will load Page.ss and include PageProduct.ss in the $Layout variable.
Hope that helps!