• Hi Katie,

    First, a great plugin, congratulations. I have a question: I was wondering if there is a way to display the call number field of an article after a search on the front-end of the site. This is useful for someone trying to locate a given article in a local collection. I have tried setting the STYLE option to chicago-library-list. This style should display the call number, but it does not appear, either on the back-end or on the front end. Any suggestion welcome.

    Thanks, Fabrizio

    https://wordpress.org/plugins/zotpress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Katie

    (@kseaborn)

    If that style should display that field, I think it must be a problem with the style, since Zotpress just requests and displays the style as it’s generated per item on the Zotero end. I would check out the wiki and support forums: https://www.zotero.org/support/styles

    Thread Starter fgabbiani

    (@fgabbiani)

    Hi Katie,

    I was not entirely clear. If I use

    [zotpressLib userid=”myarticles”]

    the call numbers display fine on the web page. However, if I use

    [zotpressLib userid=”myarticles” type=”searchbar” searchby=”items,tags”]

    and search for one article, then when the search returns the article, the call number does not display. So I don’t think it is an issue with the style, but rather with the code that does returns the search, although I know too little to understand where the issue lies exactly.

    Thanks again for your help, Fabrizio

    Plugin Author Katie

    (@kseaborn)

    Okay, I’ll check it out and see after my hiatus.

    Thread Starter fgabbiani

    (@fgabbiani)

    Thanks in advance. It looks like it has to require only a very minor change given that it works in one case. Best, Fabrizio

    Thread Starter fgabbiani

    (@fgabbiani)

    Hi Katie,

    would you be able to give me some hints on how to fix this issue? I might be able to do it myself and get back to you with the solution, but I would need some pointers as to where to look for the problem.

    Thanks and best wishes, Fabrizio

    Plugin Author Katie

    (@kseaborn)

    Sorry I have so little time! I can help with this at least. It’s probably in the JS files. I think I’ve named them similar to the shortcodes.

    Thread Starter fgabbiani

    (@fgabbiani)

    Hi Katie,

    I think I may have found how to fix the issue, but because my understanding of the code is rather limited, I wanted to run the idea by you first. I compared the code in zotpress.lib.dropdown.js, which I assume is the code used to display the library and the code in zotpress.lib.searchbar.js, which I assume is the code used to display the results of a search. I also assume that the formatting of the entries is through CSS and that this is set in a <div > directive. I see that in the dropdown code you have the line:

    tempItem += “<div id=’zp-ID-“+item.library.id+”-“+item.key+”‘ class=’zp-Entry zpSearchResultsItem hidden”;

    whereas in zotpress.lib.searchbar.js you use

    var temp = “<div id=’zp-Entry-“+item.key+”‘ class=’zp-Entry zpSearchResultsItem hidden’>\n”;

    So I was thinking that changing this line to

    var temp= “<div id=’zp-ID-“+item.library.id+”-“+item.key+”‘ class=’zp-Entry zpSearchResultsItem hidden’>\n”;

    may do the trick. Does this seem right to you?

    Thanks, Fabrizio

    Plugin Author Katie

    (@kseaborn)

    I don’t know offhand but you should be able to test it quickly — might need to hard refresh the browser to be sure the JS updates.

    Thread Starter fgabbiani

    (@fgabbiani)

    Hi Katie,

    I found a fix for the issue. In js/zotpress.lib.searchbar.js comment out the following line:

    zpSearchBarParams += “&style=”+jQuery(“#ZP_STYLE”).text();

    I am not sure what it does, but it looks like it might set the style of the query to some value different from the one defined in the admin window.

    In addition, I suggest the following change to your CSS, which makes the search box look nicer. In css/zotpress.shortcode.css add the following two “float-right” lines.

    #zp-Zotpress-SearchBox input[type=”radio”] {
    cursor: pointer;
    margin: 0.5em 0.25em 0.5em 0.5em;
    vertical-align: middle;
    float: right;
    }

    #zp-Zotpress-SearchBox label {
    cursor: pointer;
    float: right;
    }

    Yours, Fabrizio

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘displaying call numbers after search’ is closed to new replies.