Skip to Main Content

User Interfaces Standing Committee

Working site for the UISC

Display Author in Collections Page

Display Author in Collections Page

Objective: When using Primo Collections, by default the Collections page does not show any authors. This code will add in the author(s), as defined in the 245 $c MARC field (aka the "statement of responsibility"), to the results.

Example:

How to accomplish this: This solution requires the following custom CSS code be added to the /VIEW_CODE/css/custom1.css file:


/* Collection Discovery: Display Author in box */
prm-gallery-item-after {
    padding: 20px 15px;
    display: block;
    margin-top: -30px;
    background-color: white;
}

prm-gallery-item-after div {
    margin-top: -30px;
}

.is-grid-view prm-gallery-item .collection-element {
    padding: 15px;
    height: inherit;
}

prm-gallery-item .collection-element .item-title {
    padding-bottom: 30px;
}
/* Collection Discovery: Display Author in box END */

JS

//* Collection Discovery: Display Author *//
app.component('prmGalleryItemAfter', {
        bindings: {
            parentCtrl: '<'
        },
        controller: function() {
            var vm = this;
            vm.showAuthor = function() {
                vm.author = vm.parentCtrl.item.pnx.adddate.au[0] || '';
                if (vm.author !== '') {
                return true;
                }
            };
        },
        template: '
{{$ctrl.author}}
' }); //* Collection Discovery: Display Author END *//

Code credit: Santa Fe College