Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Multiple sections in the preference dialog

116 views
Skip to first unread message

Emiliano Heyns

unread,
Sep 4, 2024, 8:55:47 AM9/4/24
to zotero-dev
Can plugins have multiple sections, as Zotero itself does? BBTs prefs would benefit from this. I thought I can't really do multiple Zotero.PreferencePanes.register because they'd have the same plugin ID. Or is that OK?

XY Wong

unread,
Sep 4, 2024, 9:04:45 AM9/4/24
to zotero-dev
You could use sub-panes (https://github.com/zotero/zotero/blob/5bd5bfa343529bd1bee204c81d398c17197623a8/chrome/content/zotero/xpcom/preferencePanes.js#L110, e.g. the one in Sync - Reset - Show Reset Options) to hide some advanced options. Since users can search for the corresponding settings, I think having a very long preference pane might not be a big problem.

Emiliano Heyns

unread,
Sep 4, 2024, 9:44:35 AM9/4/24
to zotero-dev
> Since users can search for the corresponding settings, I think having a very long preference pane might not be a big problem.

But it looks to me like Zotero limits what is shown during search per-section, and if each plugin gets one section, that means all of the ridiculously long BBT section is shown when searching BBT preferences.

I will look into sub-sections, thanks.

Emiliano Heyns

unread,
Sep 4, 2024, 9:47:00 AM9/4/24
to zotero-dev
the link says "if provided, pane is hidden from the sidebar" so that means it would be hidden during search if it does not contain the setting of interest as per my description, but it wouldn't get a header of sorts?

Abe Jellinek

unread,
Sep 4, 2024, 9:49:55 AM9/4/24
to zoter...@googlegroups.com
Your pane XHTML can have multiple root elements (it’s a fragment, not a full XHTML document). Only the root elements containing text matching the search will be shown.

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/15ca5a45-0da2-44b3-852f-e43e2f1952b1n%40googlegroups.com.

Emiliano Heyns

unread,
Sep 4, 2024, 9:59:30 AM9/4/24
to zotero-dev
Ah superb, thanks!

XY Wong

unread,
Sep 4, 2024, 10:01:42 AM9/4/24
to zotero-dev
> that means all of the ridiculously long BBT section is shown when searching BBT preferences.

If the pane is really long, you could try to move the `groupbox` elements to the top level in the preferences.xhtml file. The BBT's current implementation, i.e. holding all group boxes under the top-level `vbox` element, ensures if any search is matched in the plugin's pane, the whole pane (everything in the top-level element that's matched) will be visible, If, say, the `citation keys` and the `export` are under different top-level elements, then they will be hidden unless their content has a match.

XY Wong

unread,
Sep 4, 2024, 10:04:14 AM9/4/24
to zotero-dev
My reply is the same as what Abe said. Sorry for the duplication, I didn't get the thread updated when posting the reply.

David Hoff-Vanoni

unread,
Sep 8, 2024, 10:13:43 PM9/8/24
to zotero-dev
I'm wondering if it'd be beneficial to update the Preference Panes section of the developer documentation. It currently states the following:
"Organizing your pane as a sequence of top-level <groupbox>es inside a <vbox> will optimize it for the new preferences search mechanism."

I found this to be a bit misleading because implementing such a structure means that searching will filter to your entire pane's <vbox> instead of just an individual <groupbox> because the <vbox> is the only top-level element. I see that Zotero's own preference panes do seem to be implemented this way, and the search mechanism seems to filter to the individual <groupbox>es. However, this doesn't seem to work for plugin panes for some reason.

I've attached some screenshots showing a search for a term in my plugin's pane. With one top-level <vbox>, the search shows my entire pane. Omitting the <vbox> and instead using <groupbox>es at the top level, the search filters to the individual <groupbox> as desired.

Can the Zotero team clarify the "correct" approach for this?

Thanks!

CleanShot 2024-09-08 at 18.46.17@2x.png

CleanShot 2024-09-08 at 19.03.02@2x.png

XY Wong

unread,
Sep 10, 2024, 9:03:00 AM9/10/24
to zotero-dev
Thanks, the documentation is updated.

David Hoff-Vanoni

unread,
Sep 10, 2024, 10:02:24 AM9/10/24
to zoter...@googlegroups.com
Thanks! I see the text is updated. I'd also suggest updating the code example just above it to avoid confusion.


--
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/PQftWoFkiFg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/1dfe44ca-8425-4917-8c0a-686e8d3fb9ccn%40googlegroups.com.

Emiliano Heyns

unread,
Oct 25, 2024, 9:19:34 AM10/25/24
to zotero-dev
Where would I host the onload attribute? Just the first groupbox?

Abe Jellinek

unread,
Oct 25, 2024, 9:22:02 AM10/25/24
to zoter...@googlegroups.com
Yes. All the top-level elements should receive the load event.

On Oct 25, 2024, at 9:19 AM, Emiliano Heyns <emilian...@iris-advies.com> wrote:

Where would I host the onload attribute? Just the first groupbox?
--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/zotero-dev/da332f3c-2ebb-4a6e-a9a8-ef9dd4a7406an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages