Can anyone tell me the difference between Renderings and Sublayouts in Sitecore and when each should be used? And does it make any difference when you are using MVC.
I've been going through a lot of tutorials / videos recently for Sitecore and sometimes presentation is created as a Sublayout, other times it's a Rendering both of which seem to work the same when you link it to an MVC view. There must be some difference but I haven't found anything that accurately explains what it is and when you should use each one.
The difference between Renderings and Sublayouts are simply the file types that they each represent.
In WebForms, (which was the only option in Sitecore before 6.6) these are pretty much tied to the following:-
Renderings - XSLT
Sublayouts - Web Controls (.ascx files)
For MVC (Sitecore 6.6 and up), you have the Renderings for your different MVC types. The most commonly used ones are:-
Controller Rendering
View Rendering
If you're only using MVC components, then these are the ones you'd use, as Sublayouts are more for WebForms .ascx controls.
For help with these types, I'd recommend watching Martina Welander's SitecoreMVC tutorials:-
https://www.youtube.com/watch?v=i3Mwcphtz4w
https://www.youtube.com/watch?v=dW_rQp9bMmE