<%= title %> <% if(pagination == 1 && widget_search_value.query.length == 1 && typeof widget_search_value.query[0].result != "undefined"){ if(typeof widget_search_value.query[0].result.result != "undefined"){ var pagination_query = jQuery.extend(true, {}, widget_search_value.query[0]); if(pagination_query.result != "undefined") delete(pagination_query.result); pagination_query.start = 0; pagination_query = JSON.stringify(pagination_query); pagination_query = pagination_query.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/"/g, "'"); var total_count = widget_search_value.query[0].result.total; var item_per_page = 3; if(top_layout == "single_block") item_per_page = 10; var total_pages = Math.ceil(total_count/item_per_page); var page_number = 1; var page_position = ((page_number-1) * item_per_page); var pagination_display = _.pagination(item_per_page, page_number, total_count, total_pages); %>
<%= pagination_display %> <% } } if((pagination == 0 || pagination_display == "") && typeof widget_search_value.view_all_count != "undefined" && widget_search_value.view_all_count > 0){ %>
<% if(widget_search_value.view_all_val !== null && widget_search_value.view_all_val == 1 && widget_search_value.view_all_count !== null && widget_search_value.view_all_count > 0){ %> View all <%= widget_search_value.view_all_count %> <% }else{ if(widget_search_value.view_all_count !== null && widget_search_value.view_all_count > 0){ %> Showing all <%= widget_search_value.view_all_count %> <% } } %> <% } %>
<% if(pagination == 1 && widget_search_value.query.length == 1 && typeof widget_search_value.query[0].result != "undefined" && search_key != ""){ if(typeof widget_search_value.query[0].result.result != "undefined" && typeof widget_search_value.query[0].result.total != "undefined"){ %> <% } } %> <% var query_count = 1; if(typeof widget_search_value.query !== "undefined") query_count = widget_search_value.query.length; _.each(widget_search_value.query, function( value, key ){ if(typeof value.result != "undefined"){ if(typeof value.result.result != "undefined"){ if(!_.isEmpty(value.result.result)){ block_empty_flag = false; if(layout == "content"){ %>
<% _.each(value.result.result, function( result_value, result_key ){ %> - <% if(result_value.bundle == "quotes"){ %> <%= result_value.content %> <% if (typeof result_value.tags !== "undefined"){ %> <% } %> <% }else if(result_value.bundle == "q_and_a"){ if(result_value.content != "" || result_value.content != "undefined"){ %> Q: <%= result_value.label %> <% var test_content = _.content_more(result_value.content); test_content = test_content.replace(result_value.label, ""); %> <%= test_content %> <% } }else if(result_value.bundle == "course_event_info"){ %> <% if(typeof result_value.image != "undefined"){ %> <% } %> <% }else if(_.contains(["press_release", "press_report", "aolweb_page", "what_sri_sri_said_today", "mega_event", "commentary", "landing_pages_node"], result_value.bundle)){ if(result_value.content != "" || result_value.content != "undefined"){ %> <% if(typeof result_value.image != "undefined"){ %> <% } %>
"> <% if(result_value.bundle == "aolweb_page"){ var category_name_flag = false; _.each(result_value.im_taxonomy_vocabulary_4, function( tid_search_value, tid_search_index ){ if(typeof Drupal.settings.landing_pages.taxonomy_4_cats[tid_search_value] !== "undefined" && category_name_flag == false){ %>
<%= Drupal.settings.landing_pages.taxonomy_4_cats[tid_search_value] %> <% category_name_flag = true; } }); } %>
<%= result_value.label %> <% } } %> <% if(query_count > 1){ %> <% if(_.contains(["press_release", "press_report"], result_value.bundle)){ %> News: <%= result_value.bundle_name %> <% }else if(result_value.bundle == "q_and_a"){ %> Category: Q&A <% }else if(result_value.bundle == "quotes"){ %> Category: Quotes <% } %> <% } %> <% }); %>
<% } } } } }); %> <% if(block_empty_flag == true || typeof widget_search_value.view_all_count == "undefined" || widget_search_value.view_all_count == 0){ %>
There are no <%= title %> <% if(search_key != ""){ %> pages on "<%= search_key %>" <% }else{ %> pages <% } %> <% } %>