Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    How to – Useful bookmarklets for Primo New UI troubleshooting

    Created By: Stacey van Groll
    Created on: 9/08/2019

    For those of us who are not developers, this is a compilation of various tools created by customers or provided by Ex Libris.

    I noted acknowledgements against entries when I know (or can remember) them, and take no credit personally except where noted.

    If you have written any more, please share your cleverness with the community!


    Converting to bookmarklet

    • Activate the tool with one click on a bookmarklet, rather than adding the text to the end of the URL every time
    • For end of URL: &showPnx=true
    • Base: javascript:document.location=document.location+'CHANGE THIS BIT'
    • Example: javascript:document.location=document.location+'&showPnx=true'


    Adding a bookmarklet to your browser

    • Right click on Bookmark toolbar
    • Choose Add page (Chrome) or New bookmark (Firefox)
    • Add a suitable entry into the Name field
    • Paste the javascript into the Location field
    • Click Save (Chrome) or Add (Firefox)


    Bookmarklets List


    Primo New UI Bookmarklet, developed by the awesome Gabriele Hofler

    • Latest version is March 2020, available here:
    • Displays the following in Brief Results and Full Record Display
    • NOTE 24.11.2020 Issue with Services Page, with Show PNX leading to a Redirect URL (the one from Classic UI to New UI). Checking in with the wonderful Gabriele, to see if it can be fixed.
      • Record ID
        • Record Types: Local and External PCI / CDI
        • Search States: Main Primo Basic Search and Advanced Search, additional search states of Browse Search, Journal Search, Database Search, and Newspaper Search, and externally on Primo Services Page
        • Action: n/a as display only
        • Also shows Preferred/generic FRBR record text for Local and PCI records, where the resource is in a FRBR group (n/a for CDI as logical match and merge record rather than FRBR)
        • nb Primo Services Page Record ID starts with RS, instead of the usual TN_ for PCI / CDI records
      • Show PNX
        • Record Types: Local and External PCI / CDI
        • Search States: Main Primo Basic Search and Advanced Search, additional search states of Browse Search, Journal Search, Database Search, and Newspaper Search, and externally on Primo Services Page
        • Action: Opens new browser tab
        • Primo Services Page via Google Scholar and databases like Scopus will only appear when there is no full text if direct linking is enabled
        • Primo Services Page shows the OpenURL data and technically not true PNX, as the record does not exist in the Primo database but is created dynamically from the source citation data
        • FRBR: Show PNX shows preferred record and Show Source Record shows all source records for the preferred record, with line separation
        • Dedup: Show PNX shows dedupmrg record and Show Source Record shows all source records, with line separation
        • Note for VE: Primo VE does not have a true PNX, with a fundamentally different publishing model from Alma with Primo Back Office, but it does have similar data available as a json representation
      • Show Source Record
        • Record Types: Local records only, as PCI / CDI records do not have a stored source record available to customers
        • Search States: Main Primo Basic Search and Advanced Search, additional search states of Browse Search and Database Search
          • nb issue in redirection to main Primo with general error message for Journal Search for both Primo BO and Primo VE
        • Action: Opens new browser tab
        • Displays original data, such as MARC for Alma & Dublin Core for OAI
        • Note: This is the Source Record in the Primo Database at the time of last harvest / update, which is then normalized into PNX. It is not necessarily an exact replica of the source record at the data source right now, which is yet to be harvested
        • Not available: Primo VE NZ consortia records and instead display a message that the Record ID xxxx is not in the database. These sites could use the workaround to 'Display Source Record', although this does display also to users
      • Show RIS
        • Record Types: Local records only
        • Action: Opens new browser tab
        • Uses Classic UI call, as not yet available for New UI (same data, just different URL)
        • Not available: External PCI / CDI records, and not available for Primo VE local records as per using a Classic UI, and VE was only ever on New UI
    • Known issues
      • 24.11.2020 Issue with Services Page, with Show PNX leading to a Redirect URL (the one from Classic UI to New UI). Cannot be fixed, as per consultation with Gabriele
      • 26.9.2021 Issue with using the bookmarket failing to show the links in full record overlay, after the changed pagination mandatory with the August 2021 Release
        • Only occurs when results are set to 50 results per page AND you have not yet scrolled all the way to the bottom of the page, to incrementally load all results

    Brief Results

    Show PNX

    Show Source Record

    Show RIS


    Database Search Record ID

    • Shows the local Alma database Record ID, in the brief results list of the separate Database Search UI for Primo
      • nb Leaving this for history, but the latest March 2019 version of the main Primo PNX Bookmarklet now covers this search state
    • javascript:(function(){var%20h1s=document.querySelectorAll('.item-title');for(let%20h1%20of%20h1s){var%20a=h1.children[0].href;a.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(m,k,v){if(k=='docid'){var%20cd=document.getElementById('SEARCH_RESULT_RECORDID_'+v);var%20pd=cd.parentNode;pd.insertBefore(document.createElement('div').appendChild(document.createTextNode(v)),cd);}});}})()


    Show PNX (Ex Libris)

    • If looking at the full record, this bookmarklet will display the PNX for the record in the same browser tab
    • Works for Primo Database Search (as the main combo bookmarklet doesn’t)
    • javascript:document.location=document.location+'&showPnx=true'


    Swap to CDI Results (Ex Libris)

    • Only relevant for sites who are in the Enablement phase of CDI rollout, starting February 2020
    • If looking at a list of brief results, this bookmarklet will run your query against the Central Discovery Index (CDI) instead of the Primo Central Index (PCI), enabling testing prior to sites choosing to Switchover fully to CDI
    • After using this bookmarklet, use the standard New UI bookmarklet detailed on this page to show the record information eg Show PNX and Record ID
    • You'll note that the record prepends have changed from TN_xxx to TN_cdi_xxx
    • Refreshes results from PCI to CDI: javascript:document.location=document.location+'&searchCDI=true'
    • Opens a new tab with results on CDI (make sure to allow popups):'&searchCDI=true')
      • Shared on listserv by Graham Fredrick (Purdue University)


    Show Directives

    • If looking at a list of brief results, this bookmarklet will display the text for web writing.  Refreshes the same browser tab.
    • javascript:(function(){var script=document.createElement("SCRIPT");script.src='"head")[0].appendChild(script);var checkReady=function(callback){if(window.jQuery){callback(jQuery)}else{window.setTimeout(function(){checkReady(callback)},100)}};checkReady(function($){$('primo-explore').find('*[parent-ctrl="$ctrl"]').each(function(){$(this).append('<a href="#" title="'+$(this)[0].outerHTML.replace(/</g,'').replace(/>/g,'').replace(/\//g,'').replace(/"/g,'').replace(/parent-ctrl.*/g,'').replace(/-([a-z])/g,function(m,w){return w.toUpperCase()})+'" style="display:block;height:auto;color:black;">Hover for id</a>')})})})();


    Custom JS

    • Show your local custom javascript for Primo Back Office sites aka primo-explore.  Refreshes the same browser tab.
    • javascript:location.href=location.href.replace(/primo-explore.*vid=((.+?)(&|$)).*/,'primo-explore/custom/$2/js/custom.js');


    No Custom (Ex Libris 2018)

    • Removes your local custom code to see Primo OTB UI, useful to quickly see if local code is causing a conflict, or if it’s an Ex Libris OTB issue.  Refreshes same browser tab
    • javascript:document.location=document.location+'&noCustomization=true'


    Show Performance (Ex Libris IGeLU/ELUNA Show & Tell 24.1.18: Primo - Performance Enhancements with the New UI)

    • See loading times in milliseconds and assess performance.  Adds block to top of screen after refreshing same browser tab.  Close browser tab to remove.
    • Note: Seemed to not be working for Server monitor section for Primo VE in very late 2019, but working as of early 2020, just with different data
    • javascript:document.location=document.location+'&show_performance=true'
    • Details / example
      • Client monitor
        • total search time: 876
        • search api response time: 651
        • results render time: 225
      • Server monitor
        • total search api time: 34
        • search time: 14 — the time Primo takes to search the index and get the records
        • delivery manager time: 116 — time to calculate the availability of different records. This calculation was separated from the search api process in 2017 to improve performance


    Change your View by prompt for Primo BO (SvG UQ)

    • Presents a popup box to type in your VID to easily change between views
    • javascript:location.href=location.href.replace(/explore.*/,'explore/search?vid='+prompt('VID?','Your View Code'));


    Display results from a specific ‘page’ (SvG UQ)

    • The New UI does not have pages.  The original design was endless scroll (August 2016), but this was changed to a bulk load of 10 results in February 2017
    • If clicking ‘Load more results’ repeatedly is getting you down, you can change the offset parameter in the URL to display results for a specific ‘page’
    • To display the next bulk load of 10 or more, change the offset from &offset=0 to &offset=11, or 101, or 501, or 1001, etc
    • javascript:location.href=location.href.replace(/&offset*/,'&offset='+prompt('offset?','add offset here'));


    From here down, all of these are options for showing CTO easily

    What is CTO and why should you care?

    • CTO: Context Object
    • A hugely valuable troubleshooting tool!
    • This gives a view into the metadata of a record (and beyond if augmentation such as CrossRef is enabled), which is being used by the Link Resolver to match to bibliographic records and return associated services as a result of those matches
    • The display includes valuable information such as
      • the target URL and the standards identifiers - as of 2021, all the identifiers in the displayed record in Primo are NOT used to match to bibliographic records
      • record numbers from Alma to do further checking and correlate to activation collections, such as your 61 ID for electronic collections and your 51 ID for your portfolios
      • a full list of services resulting from the bibliographic match, parser parameters, and resolution URL
      • and any filters showing why the service might be hidden from users, such as Date Filter True due to coverage not match the record

    Display CTO on Primo Back Office (SvG UQ)

    • Right click on the View It or Get It frame
    • Select View frame source
    • javascript:location.href=location.href.replace('openurl?','openurl?svc_dat=CTO&debug=true&')


    Display CTO on Primo Back Office (Geoffrey aka Jeff Peterson University of Minnesota)