Created
December 23, 2014 19:32
-
-
Save rajesh-h/23ceca5c2cbf28d62f41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_menu(). | |
*/ | |
function module_categories_menu() { | |
var items = {}; | |
items['categories_view'] = { | |
title:'Subscribed Products', | |
page_callback: 'module_categories_articles_page' | |
}; | |
return items; | |
} | |
/** | |
* The page callback to display the view. | |
*/ | |
function module_categories_articles_page() { | |
try { | |
var content = {}; | |
content['my_categories_list'] = { | |
theme: 'view', | |
format: 'ul', | |
path: 'category-view', /* the path to the view in Drupal */ | |
row_callback: 'module_categories_articles_list_row', | |
empty_callback: 'module_categories_articles_list_empty', | |
attributes: { | |
id: 'my_categories_list_view' | |
} | |
}; | |
return content; | |
} | |
catch (error) { console.log('module_categories_articles_page - ' + error); } | |
} | |
/** | |
* The row callback to render a single row. | |
*/ | |
function module_categories_articles_list_row(view, row) { | |
try { | |
/*return l(row.title, 'node/' + row.nid);*/ | |
return l(row.name, 'taxonomy/term/' + row.tid); | |
} | |
catch (error) { console.log('module_categories_articles_list_row - ' + error); } | |
} | |
/** | |
* | |
*/ | |
function module_categories_articles_list_empty(view) { | |
try { | |
return 'Sorry, no articles were found.'; | |
} | |
catch (error) { console.log('module_categories_articles_list_empty - ' + error); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment