• Resolved krstoski

    (@krstoski)


    Hi,
    i am not a native English-speaker, so please apologize my english.
    I searched the last days about my problem. I could generate on my word-press-site a searchbar with zotpress. I could not find a solution, that only one certain collection can be searchable. I don’t want to have my entire library searchable – I just need to have one collection of my library (no group-library) available.

    I got zutilo installed and I could find out the collection ID, but could not have limited the search only to this one collection.

    Is there a simple solution, since I am not into programming?
    best
    Igor

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi!

    I’m not the developer, but I had the same problem recently, I’m discussing it here : https://www.ads-software.com/support/topic/add-collection_id-filter-to-searchbar-shortcode/

    As I said there I found a workaround. The best would be for it to be included in the official release of course, but in the meantime maybe you want to give it a try. I think it’s not too complex, even without programming skills, provided you have access to your website files.

    – Add the line below in the file your-website-folder/wp-content/plugins/zotpress/js/zotpress.lib.searchbar.js at line 45 (just after the other similar lines) :
    zpSearchBarParams += "&collection_id="+jQuery(".ZP_COLLECTION_ID").text();
    – Copy the file (zotpress.lib.searchbar.js) overwriting the file zotpress.lib.searchbar.min.js in the same folder.
    – Add collection_id=”your-collection-id” as parameter in your shortcode (for instance [zotpressLib nickname=”zotero-nickname” type=”searchbar” collection_id=”GDLV8SGX”] )

    The biggest downside of this method is that this fix will be overwritten if you update the plugin. But hopefully Katie will implement it in the next release ??

    Best

    • This reply was modified 2 years, 8 months ago by alhrath.
    Thread Starter krstoski

    (@krstoski)

    Hi, thanks for your quick answer. I found a solution, which fits my skills: I created another Zotero account, got a new zotero-ID. Then I found out how to add my new profile in zotero, having now two Zotero-profiles. Then I started Terminal on my Mac to add the new profile in zotero.

    macOS

    Open Terminal via Spotlight or /Applications/Utilities.
    Paste /Applications/Zotero.app/Contents/MacOS/zotero -P into the Terminal window.
    Press Return

    Windows

    Open the Run dialog (Search/Cortana → type “Run” → Run (Windows 10) or Start → Run (Windows 7)
    Paste C:\Program Files (x86)\Zotero\zotero.exe -P
    Press Enter

    Next step was to take off the hook on “use the selected profile without asking at startup” – which is good – I can choose which profile on zotero I want to work, when I start zotero.

    With my second zotero profile I got a new ID for my second library. I added this library ID in zotpress. It works now perfect.

    Best

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display only one collection for searchbar’ is closed to new replies.