single page site using orchard

Topics: Customizing Orchard
Aug 23, 2012 at 2:55 PM


   i need to implement a single page application in an orchard site.
   the main idea i have at the moment is quite simple: i would like to create the site normally, and add a jquery script that on the click of the a link trap it, extract the href, make an ajax request for the page and send the result in the main div, updating the content of the page without asking a full refresh of the page. this way, the link in the page are wrote normally so i don't have any SEO problem.
  do you think is a good idea ?
  to obtain this result i need that normally the page is render using the normal template, but if i do the ask of the content via ajax i need to do this using a smaller template, that doesn't include the area of the main outside the main div. how can i do this?





Aug 25, 2012 at 2:58 AM

You could create your own controller that fetches the content item that you want to render, render that content item using IContentManager.BuildDisplay using a partial view. Your AJAX callback would then inject the HTML result into the DOM element of your choosing.

Aug 28, 2012 at 5:14 AM

ok, thanks i'll give a try