Skip to content

Instantly share code, notes, and snippets.

@allgood2386
Created September 20, 2013 19:52
Show Gist options
  • Save allgood2386/6642906 to your computer and use it in GitHub Desktop.
Save allgood2386/6642906 to your computer and use it in GitHub Desktop.
<?php
function taoti_javascript_menu() {
$items['slider/%/news-embed'] = array(
'page callback' => 'taoti_javascript_get_news_view_embed',
'delivery callback' => 'taoti_javascript_get_embed_wrapper',
'page arguments' => array(1),
'access callback' => TRUE,
);
$items['slider/%/topic-embed'] = array(
'page callback' => 'taoti_javascript_get_topic_desc_view_embed',
'delivery callback' => 'taoti_javascript_get_embed_wrapper',
'page arguments' => array(1),
'access callback' => TRUE,
);
return $items;
}
function taoti_javascript_get_news_view_embed($termID) {
return views_embed_view('news', 'latest_news_slider', $termID);
}
function taoti_javascript_get_topic_desc_view_embed($termID){
return views_embed_view('taxonomy_slideshows', 'taxonomy_slider_description', $termID);
}
function taoti_javascript_get_embed_wrapper ($page_callback_result) {
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
global $language;
drupal_add_http_header('Content-Language', $language->language);
print $page_callback_result;
drupal_page_footer();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment