I'm making a website (don't open in IE) where I use Ajax to load a view. I now want to use BOOST to cache the view as HTML.
These pages should be "BOOSTED":
http://www.spanjevakantiewinkel.nl/regio/ajax/8 http://www.spanjevakantiewinkel.nl/regio/ajax/9 ...
Should I use JSON instead of my way to load the view? Any idea how?
The ID (8,9,...) is given by hovering a small image beneath the large header image. Then the view will be loaded, but always within the database, I want HTML pages made with BOOST.
function dynamic_regio_menu() {
$items = array();
$items['regio/ajax'] = array(
'title' => 'Dynamic Regio',
'page callback' => 'dynamic_regio_get_by_category_id',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
return $items;
}
function dynamic_regio_get_by_category_id($cat_id){
$viewName = 'regio_submenu'; // The name of the view we are going to load
$args = array($cat_id); // Array of arguments we set for the view.
$displayId = 'block'; // The display id of for the view.
// Call the views_embed_view function to returned themed view output
$html = views_embed_view($viewName, $displayId, $args);
echo $html;
}
xhr = $.ajax({
type: 'POST',
url: '/regio/ajax/' + this.parentNode.getAttribute('tid'),
success: updateData, dataType: 'html',
});
POST
requests.