label”).text(“Enter search term”); } }); ]]>
Search by keyword
Enter search term
= 768 ? true : false; /* Set the width of the sidebar to 250px and the left margin of the page content to 250px */ function openNav() { if(screen.width >= 768){ $(“#facets”).css(“width”, “30%”); $(“#search-results-container”).css(“width”, “69.9%”); $(“#search-results-container”).css(“padding-left”, “3%”); } else { $(“#facets”).css(“width”, “100%”); $(“#search-results-container”).css(“width”, “0%”); $(“#search-results-container .search-results .result”).css(“box-shadow”, “none”); $(‘#closebtn-xs’).css(“display”, “inline-block”); $(‘#icon-filter-xs’).css(“display”, “inline-block”); $(“#search-results-container”).css(“max-height”, “0”); } $(“#facets”).css(“max-height”, “inherit”); navStatusOpen = true; $(‘#openbtn’).css(“display”, “none”); $(‘#closebtn’).css(“display”, “inline-block”); $(“.fa.fa-filter”).prop(‘title’, “Collapse filters”); $(‘#facets’).find(‘:focusable’).removeAttr(‘tabindex’); } /* Set the width of the sidebar to 0 and the left margin of the page content to 0 */ function closeNav() { if(screen.width >= 768){ $(“#search-results-container”).css(“padding-left”, “0”); } $(“#search-results-container .search-results .result”).css(“box-shadow”, “0 0 3px #999”); $(“#search-results-container”).css(“max-height”, “inherit”); $(“#search-results-container”).css(“width”, “99.8%”); $(“#facets”).css(“width”, “0%”); navStatusOpen = false; $(‘#openbtn’).css(“display”, “inline-block”); $(‘#closebtn’).css(“display”, “none”); $(“#facets”).css(“max-height”, “0px”); $(“.fa.fa-filter”).prop(‘title’, “Expand filters”); $(‘#facets’).find(‘:focusable’).attr(‘tabindex’, -1); } /* open or close depending on the status of the sidebar */ function manageNav() { if(navStatusOpen){ closeNav(); $(“.icon-filter”).prop(‘title’, showFilters); } else { openNav(); $(“.icon-filter”).prop(‘title’, hideFilters); } } var collections = new Map(); collections.set(‘dataset’, ‘Datasets’); collections.set(‘CAT_CATALO’, ‘Leaflets and other brochures’); collections.set(‘CAT_DATFOC’, ‘Data in focus’); collections.set(‘CAT_EURNEW’, ‘News articles’); collections.set(‘CAT_MAN’, ‘Manuals and guidelines’); collections.set(‘CAT_PREREL’, ‘Euro indicators’); collections.set(‘CAT_STATBK’, ‘Statistical books/Pocketbooks’); collections.set(‘CAT_METWP’, ‘Statistical working papers’); collections.set(‘CAT_STAFOC’, ‘Statistics in Focus’); collections.set(‘CAT_DEDSEC’, ‘Thematic sections’); collections.set(‘CAT_STATRP’, ‘Statistical reports’); collections.set(‘CAT_DIGPUB’, ‘Interactive publications’); collections.set(‘CAT_FLAGPUB’, ‘Flagship publications’); collections.set(‘CAT_KEYFIG’, ‘Key Figures’); collections.set(‘CAT_STATEXP’, ‘Statistics Explained articles’); collections.set(‘CAT_GLOSSARY’, ‘Glossary’); collections.set(‘CAT_STAT4BEG’, ‘Statistics 4 beginners’); collections.set(‘CAT_PODCAST’, ‘Podcasts’); collections.set(‘tree folder’, ‘Data tree folder’); collections.set(‘collection’, ‘Products’); collections.set(‘theme’, ‘Statistical themes’); $[ “ui” ][ “autocomplete” ].prototype[“_renderItem”] = function( ul, item) { return $(“
” ) .css(“display”, “flex”) .css(“flex”, “auto”) .append( $( “” ) //.css(“display”, “flex”) .css(“flex”, “auto”) .css(“flex-direction”, “column”) .css(“display”, “block”) .css(“width”, “1px”) .css(“padding-right”, “20px”) .css(“max-height”, “none”) .append( $( “” ) .html(item.suggest != null ? item.suggest.highlightPhrase : item.label ) ) ) .append( $( “” ) .css(“display”, “flex”) .css(“flex”, “0 1 auto”) .css(“align-self”, “center”) .append( $( “” )
//.css(“font-size”, “1.3rem”)
.css(“font-family”, “arial, sans-serif”)
.css(“font-weight”, “normal”)
.css(“color”, “#0e47cb”)
//.css(“font-style”, “italic”)
.css(“text-transform”, “uppercase”)
.html(collections.get(item.type) != null ? collections.get(item.type) : item.type)
)
)
)
.appendTo( ul );
};
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).autocomplete({
minLength: 3,
source: function(request, response) {
$.getJSON(“https://ec.europa.eu/eurostat/en/web/products-eurostat-news/w/ddn-20250305-1?p_p_id=estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&assetEntryId=21132938&_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_action=autocomplete”, { text: request.term }, response);
},
open: function() {
$(this).autocomplete(“widget”).css(“width”, $(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).outerWidth(true) + $(“.ecl-search-form__button._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).outerWidth(true));
},
focus: function(event, ui) {
event.preventDefault();
},
select: function( event, ui ) {
var url = new URL(document.getElementById(‘search-form-id-_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_’).action);
if(ui.item.type==’collection’){
url.searchParams.set(‘_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_collection’, ui.item.code);
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).val(“”);
} else if(ui.item.type==’theme’){
url.searchParams.set(‘_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_theme’, ui.item.code);
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).val(“”);
} else if(ui.item.type==’tree folder’){
url.searchParams.set(‘_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_folderTitle’, ui.item.suggest.highlightPhrase.replace(/(]+)>)/ig,””));
url.searchParams.set(‘_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_collection’, ‘dataset’);
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).val(“”);
} else {
url.searchParams.set(‘_estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_text’, ui.item.suggest.highlightPhrase.replace(/(]+)>)/ig,””));
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).val(ui.item.suggest.highlightPhrase.replace(/(]+)>)/ig,””));
//$(“input[name*=’collection’]”).val(ui.item.type);
}
event.preventDefault();
window.location.href=url.href;
},
change: function( event, ui ) {
if(ui.item != null){
$(“.main-search-field._estatsearchportlet_WAR_estatsearchportlet_INSTANCE_bHVzuvn1SZ8J_”).val(ui.item.suggest.highlightPhrase.replace(/(]+)>)/ig,””));
}
event.preventDefault();
},
/*response: function(event, ui) {
if (!ui.content.length) {
var noResult = { value:””,label:”no_results_found” };
ui.content.push(noResult);
}
}*/
});