Now Loading

FAQ

1. Q: When is custom js code being executed? 

A: On initial page load and on any navigation event 


2. Q: I want my custom js to be executed only once. Ho do I achieve that? 

A: Consider using the following js code snippet: 

if (document.ezxOnLoad !== true) { 

document.ezxOnLoad = true; 

//YOUT CODE GOES HERE 


3. Q: I want to change certain labels. Is this possible? 

A: Yes, you can do it through custom js. Here is sample code: 

document.translationOverrides = { 

“*”: { 

“Download Basket”:”Download Cart”, 

“lightbox”: “Cart” 

}; 

Here labels “Download Basket” and “lightbox” are replaced with custom values “Download Cart” and “Cart”. 

NOTE: while most labels can be taken right from UI, some of them have “special” values which should be used instead (like lowercase “lightbox” in our example). You can get the list of all “special” values from the file /var/www/html/ezx/assets/locale/en.json 


4. Q: Can I rename basket plugins with custom js? 

A: Yes, add the following snippet to your custom js: 

document.basketPluginTitles = { 

basketadmin: “Administer Collections”, 

afr: “Request Hi Res Clips & Info” 

}; 

This will rename “Administer Basket” and “Asset Fulfillment Request” plugins. 

NOTE: the list of “real” plugin names can be found on Webnative server in /usr/adm/webnative/basket.config file. 


5. Q: I want to reset quick search parameters every time a user logs in. How do I do this? 

A: You can do it using the following custom js snippet: 

if (window.location.pathname.includes(‘/login’)) { 

let d = new Date(); 

d.setTime(d.getTime() + (24 * 60 * 60 * 1000)); 

let expires = `expires=${d.toUTCString()}`; 

let quickSearchValue = ‘{“filenameOnly”:false,”currentPathOnly”:false}’; 

document.cookie = `ezx-quick-search=${quickSearchValue};${expires};path=${document.cookiePath}`; 

This will reset quick search cookies on every login. 

NOTE: you can modify any ezx cookie this way. Just add 

document.cookie = `<COOKIE NAME>=${<COOKIE VALUE>};${expires};path=${document.cookiePath}`; 

line for every cookie you want to modify. 

NOTE: all ezx related cookies start with prefix “ezx-” 


6. Q: Can I change default advanced search option to “Search All”? 

A: Yes, add this snippet to your custom js: 

document.advancedSearchDefaultOption = ‘SEARCHALL’; 

You can use any advanced search option as default one. Here is an example of using a keyword as default advanced search option: 

document.advancedSearchDefaultOption = ‘DBSEARCH_KEYWORD_156’; 

NOTE: you can find the list of possible advanced search options either in Webnative documentation or by examining EZX advanced search option dropdown in your browser dev tools.