The Fragment API was introduced in WebCenter Sites 12c (WCS) to better handle how the HTML markup blocks are included on a web page.  Working alongside the new Controller infrastructure in 12c, the Fragment API provides a Java API and a tag library that works in conjunction to allow for separation between business logic around generating the HTML block versus rendering these blocks. 

The Fragment API is used in lieu of the ‘render’ JSP or XML tags to render the resultant pagelet of a template, element or site entry.  An example will be...