Displaying # of pages in Item Type Menu

I'm new to Zotero and still trying to get the basic hang of it. I think I may be missing something super obvious but in the field listings (creator, item, year, publisher, etc.), I want # of pages to list. When I select "pages" as a field to display, all the items remain blank.

The number of pages is present as part of each item's info (i.e. # of pages is filled out with a specific number for each listing) -- and with other fields, like the title, an alteration of the info also alters the text that displays on the item title. In this case, making changes to # of pages doesn't seem to be listing any information under the pages field.

I looked through the forums but didn't quite see anything which dealt with this specifically. It's probably something super obvious, but any help would be majorly appreciated.
  • edited August 14, 2018
    That field simply isn't available as a column in the middle panel -- it also doesn't seem particularly useful, since I don't think one would be inclined to sort by number of pages. Why do you want it in the middle panel?
  • Thanks so much for clearing that up! Much appreciated! You're right -- it's not really for referencing functions per se -- but there are a couple of reasons. The first is to do with reading mood and quantitative research rate. When I'm in the mood for a quick leisure read or wish to maximise a window of research per number of books as well as strictly by quality, I like to pick items at random based on how quickly, page-wise, I'm liable to be able to get through it.

    The second thing is more a matter of curiosity as to how many total pages I might have in my library (which would have been my follow-up question: whether there was a means to have Zotero calculate and supply that information).

    I've never done a lick of coding, but I notice that there is a lot of DIY script advice in the forums here. Is this something which could be altered through that means or would it require, if it were to ever be added, an updated version of the program?
  • edited August 14, 2018
    I'm not an expert, but just to respond from a similar perspective. Feel free to completely ignore my (admittedly long) response here if it doesn't seem helpful, but maybe a "preview" of what's to come if you decide to start writing/changing code will help. More practical suggestions on how to view number of pages are at the end of this reply.
    I've never done a lick of coding, but I notice that there is a lot of DIY script advice in the forums here.
    Most of the coding advice here is specifically for the CSL citation styles, and that is very approachable and not too hard to learn even if you're just starting out.
    My background is in web design (including some programming on web servers), so I have sort of complementary coding skills (self taught) that give me somewhere to start, but not specifically with Zotero. I personally have been trying to customize my Zotero experience for about the past two weeks. My experience has been that it's very easy to modify the CSL files-- it took me about two days to get comfortable with that, by trial and error and asking some questions here, and now for most standard functions I think I could handle it on my own. (If you aren't at all familiar with XML or HTML in general you might need a little more time, but you can copy from existing examples while you learn.)
    On the other hand, I've tried several times to dive into the code of the program itself, including for how to display the fields in an easily readable/sortable format (I was trying to clean up my database for consistency), and more recently trying to customize a function so that author names could be inserted via Zotero. In the end, I found this was over my head even with some (though not directly applicable) programming background. Unless this is very important to you, I'd be hesitant to try to actually rewrite the Zotero code to add a middle column. My rough guess is that if you did seriously want to learn coding and try to figure out how to modify Zotero, it might take you 6 months to a year for the basics if you dedicated a reasonable amount of time to it (and yes, I'd say adding a column to the middle, following examples of what's already there, would be just "basics", so that's the 'good news' perspective for this question).

    Regarding my experiences sort of stumbling through the Zotero code, you can read about them at the links below. I'm not suggesting at all that they will be of any particular interest to you, just that if you have no idea what coding would be like, that might give you a sense of whether you want to dive into it.
    https://forums.zotero.org/discussion/73159/announcing-zoterzero-for-author-only-cites (see also linked discussions there)
    https://forums.zotero.org/discussion/73007/cleanup-names-of-creators-publishers-cities-etc (most relevant to what you asked)

    Personally I would not recommend actually trying to rewrite Zotero's code, given your self-described lack of experience and how my lack of experience made that seem too daunting. The problem isn't that it's necessarily hard to make changes, but that it's very hard to find the right places in the many thousands of lines of code (and many sub-systems, each of which may be written in a different language!). If I knew exactly where something was written, I could probably change it in 1/10th the time it would take me to find it in some cases. That's why I've given up trying to modify the Zotero program itself. (Plus there are other good reasons for not modifying the core program-- updates, support, etc.)

    As an aside, your reasoning for wanting the number of pages to appear in the middle column makes perfect sense to me, and for someone who does know how to change the Zotero code for the next version I don't see why it shouldn't be included. It's a reasonable way to mentally organize your references, or even to find something, such as a particularly long unpublished manuscript. Rarely but potentially useful!

    Now, regarding page numbers, I see two ways you could approach this if you don't actually modify Zotero's source code:
    1. As discussed in the second linked question above, you can export a CSV of your library and just search/sort that in Excel. That's by far the easiest answer if it works for you, and you could easily use Excel's SUM() function to see how many pages are in your library overall, assuming you have the number of pages stored for all entries. If you need to get more in depth than that for some reason, you could actually try to get into the SQL database behind the program, but that's very complicated (for which see the linked discussion about dates in my last post addressing that question).
    2. Another relatively easy answer probably would be to learn how to make your own CSL style, where you display the number of pages for each work, and then presumably also sort by the number of pages. This would give you a "bibliography" (that you could generate for your whole library) that shows the information you want. You could of course also calculate the total number of pages etc. (Note: you could decide if you want to display ONLY the number of pages, so that is your whole "bibliography", or if you want it just as part of each entry along with author, title, etc. If you display only page numbers it could obviously be easier to sum up all of the numbers, e.g., copying to an excel spreadsheet.) The secondary advantage to this is that you'd learn how to use CSL in case you ever wanted a customized style for another reason. And it's by far the easiest way to modify Zotero, and has no risk of damaging the program or database, since it's just a way to display the data, not change anything.

    There's some info about writing CSL here if you want to try that:
    https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
  • The available columns in the middle pane cannot be modified in a way that won’t be overwritten by future Zotero updates without a lot of extra coding. My recommendation would be to export to CSV and then look at the # of pages column in Excel.
  • Came across this post, same question: sorting # of pages would be nice. "Num pages" is part of CSV, but that's external.
Sign In or Register to comment.