[New Feature] Custom Item Type


I often have some entry for which I would like to have a non-existing specific type, e.g. tweets. I am a bit puzzled by the fact that I cannot, apparently, create custom types. I feel that such an option would be very useful to both the users (more flexibility) as well as the developers (because the users community could handle the development of new types).

Defining a custom item type would imply:
- Defining the name and icon (with, ideally, the possibility to use custom icons),
- Defining the type name for BibTeX (@…),
- Defining the fields: in addition to the many fields already available, it would be nice to be able to define custom fields (name in Zotero's UI, name in BibTeX, is it a string or a date or a name (like authors)…?).

Ultimately, it would also be great to be able to refine the way the data is collected when the reference is added from a web browser, i.e. define (for example) a list of domains from which the type apply (or a regexp test on the URL) as well as how fields are read.

Although a UI for creating new types would be neat, this is absolutely not necessary: defining new item types from some code would be sufficient for the feature to bring many benefits.

Note that this is more than just a user feature. Again, relying on the community to create and share custom types could allow more people to be involved in this task. Sure, everybody can technically contribute to the code through GitHub, but a) the barrier of entry would be significantly lower if one does not have to find their way through the whole project but just has to learn how to create one custom type, and b) highly specific types or flimsy-but-sufficient implementations should not be in the standard, shared software anyway.

  • Custom item types are planned for the medium term, but it is a very technically difficult problem, especially if users expect to be able to include such types in citations.
  • Isn't it time to sticky this request? It comes up fairly regularly.
  • edited August 22, 2020
    @bwiernik I think one possible solution to the very difficult problem you mention is to alias new names in the UI to types to existing types. That is, in the case of the OP who is citing tweets, these might be citeable as web pages, or they might be citeable as instant messages (tweet threads), or also as a forum post. However, it is likely that for Zotero users (and people in general) that tweet's exist as a separate mental 'category' and don't think or look to see how to categorize the content they are trying to cite. I know this has been my area of growth... thinking about the things I want to cite in terms of how they match the existing categories vs. how I am thinking about them.

    It is possible that this is one reason that the APA 7th has so many examples for Social Media citations: https://apastyle.apa.org/style-grammar-guidelines/references/examples#online-media

    Using the alias method, allows for a UI which matches the mental paradigms which user have, but also does not require support for new types according everyone's mental schema.

    I believe that the alias method was used by papers 2 and papers 3 to give users access to a large variety of "item types" and still make them all citeable.
  • I think @hughp3 has made a very intelligent and practical suggestion, and I second it.
  • Building/sedgeway on @hughp3, I would propose the following: Add a new 'type' called 'generic'. The item panel would look like:

    Item type: [Custom]
    Format citation as: [Journal Paper] (Drop down, including the usual types.)
    Custom item type: Tweet (Free text, i.e. can be entered at authors discretion)
    Title: (Free text)
    Author(s): ...
    Followed by all available fields
    Extra: (free text)
    Custom field 1:
    Custom field 2:
    Custom field 3:
    Custom field 4:
    Custom field 5:
    Date added:
    Date modified:

    There have always been questions how Generic fields would tie into the CSL. Here, the Custom fields are just ignored by the usual CSL styles. However, I could write my own, that would use those.
  • edited August 22, 2020
    @bjohas as a mental exercise in the pursuit of minimalism, Why would one need a new itemType labeled 'Custom ItemType' if they are going to use as a Journal Article? One can already use the generic itemtype (document) and then use the 'extra' field and add CSL variables in them. So, one could start off with a Conference Paper item type and tell Zotero to process it as a Journal Article.

    I'm not sure that custom fields are the right way to go either. I like them. I use them in EndNote, but is it the best way forward for Zotero? One way around the custom field issue for Zotero would be to allow CSL processing to access the Notes in Zotero. Notes could contain what is essentially a key's value (thinking in terms of key: value pairs): '__annotation', or '__isCiteBy', or '__cites' these values could then be acted-upon in some manner in the style sheet. It may be cumbersome in terms of the current UI, but in someways it lowers the amount of architecture changes needed to support customized data values.
  • Full-on, enthusiastic agreement about the need for this. Would the ability
    to specify the style of citation for the custom item type on top of the chosen style help with the technical difficulty? No idea about this but would really like to see this implemented somehow.
  • I would also like to see this implemented. My company writes many reports for the an organization that has their own in-house citation style. I want to create my own CSL for it, which is no problem, but they have a very particular way they want their own papers cited and I'd like to be able to make an "EPRI" item type. Really hope this gets traction.
  • @juliakeelerpeck if that style would only be used by you or a very limited number of users, you can already implement that. If you put type: EPRI in the Extra field, the citation processor will treat the item as of type EPRI and it will apply rules from a CSL-style defined for that item type.

    The downside to this approach, and the reason why it isn’t promoted widely, is that it isn’t valid CSL (Zotero might warn you about it when you install a style containing invalid fields or types) and as such can’t be distributed via the style repository.
  • I'd phrase the warning a bit more strongly: It also means this won't travel at all to other tools (e.g. if you wanted to work with markdown) and I don't think Zotero or CSL would be willing to make any assurance that this will keep working (I'm not saying it will necessarily break -- I'm just saying we definitely won't promise it will not, nor will there be any deprecation notice or so since this isn't actually a feature).
  • "Web page," "instant message" and "forum message" treat the whole tweet's text as a title, so they """Capitalize all the First Letters Except for the Prepositions and Articles."""

    Other than that they're quite a good solution.
  • @juliakeelerpeck If I understand @ptornielli he suggest you might be able to use a valid item type of an obscure item within the kinds of things you typically reference. You can still use the same item type fields within Zotero but then in the extra field add type: forum ... or whatever the type ID is for forum messages.
  • + 1 on custom fields. I'd like to tie in my DEVONthink URL to link the file to my DT3 database.
  • +1.

    The fields I have in mind wouldn't need to be included in (custom) citations, but would rather just be available for filtering and record-reviewing purposes w/in Zotero's GUI.

    In terms of UI, having the keys and paired values w/in the Info tab would be better than having it implemented in Notes, but I understand that might cause too much under-the-hood data design/maintenance/integrity/CSL-conformity challenges.

    Tags could work for me. However, I'd tend to implement de facto key values as pre-pended strings before the value components of the tags, which is somewhat more cumbersome and (if heavily abbreviated) opaque. The "Extra" field can be used for this purpose as well, but has the disadvantage (field-internally) of being unstructured "free" text, and of not allowing for selection from (autocomplete-prompted) pre-populated lists to facilitate input speed and data consistency.
  • +1
    I regularly add policies to my bibliography and thus far I select "statue" for it. @hughp3 's suggestion would be really fitting.
  • +1
    In the CSL specification there is a standard variable "dimensions" = Physical (e.g. size) or temporal (e.g. running time) dimensions of the item

    However there seems to be no Item Type available for incorporating the standard variable.

    Additionally, in the Item Type "Journal Article" there is a seemingly non-standard variable "Extra" that, to me, is not possible to include in a custom format style.

    A Custom Item Type creation tool might help.
  • CSL's dimensions is mapped to from Map - Sale and Artwork - Arwork size.

    It can be used in any item type by using
    dimensions: 123cm in the Extra field.

    The Extra field is CSL note
  • +1 for @hughp3 's suggestion specifically!
Sign In or Register to comment.