Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

On the full record display, the links section can contain many repeated and or unused 856 links that institutions may not want to show. Because Primo VE does not allow for configuring the links section display properties, the best solution is to hide the links using CSS and JS in the configuration package. As an alternative, institutions can completely hide the links section using the below mentioned code.

Solution and code provided by: Jessie Cai

  1. Modify the css/custom1.css file in your desired Primo VE view configuration package. Add the following code:

    /* Hide 856 Links */
    .hide856 { display: none; }

  2. Modify the js/custom1.js file in the same configuration package. Add the following code to the end of the file, BEFORE the final })(); tags.

    Note: the following code works by adding the .hide856 style to all links EXCEPT ones with link text that matches the keep variable. If your link text is different than the ones listed, modify the keep values to match your link text. Doing so will exclude those links from being assigned the .hide856 style and thus displaying them in the links section.

    // Hide 856 Links
    app.component('prmServiceLinksAfter', {
        bindings: {
           parentCtrl: '<'
        },
        controller: function() {
            angular.element(document).ready(function () {
              var lNodes = document.querySelectorAll("prm-service-links > div > div");
                    
              // If links are not showing up, 
              // modify the keep values to match the desired link text
              
              var keep = ["Display Source Record","Finding aid","Search for the article title on Google Scholar","Request Document via Interlibrary Loan"];
              
              for (var i =0;  i < lNodes.length; i++) {
                  var eNode = lNodes[i];
                  var label = eNode.querySelector("a > span").textContent;
                  if (!keep.includes(label)) {
                       eNode.classList.add("hide856");
                  }
              }
            });
        }// end controller
    });

  3. Upload the new configuration package to your desired view and save/publish the changes.

Hiding the Links Section (Optional)

  1. Modify the css/custom1.css file in your desired Primo VE view configuration package. Add the following code:

    Note: you do not need to include the above mentioned JavaScript if you want to hide the links section.

    /* Hide Links Section */
    #links { display: none; }

  2. Upload the new configuration package to your desired view and save/publish the changes.

  • No labels