Project

General

Profile

Feature #9940

CUNY OneSearch widget

Added by Boone Gorges 11 months ago. Updated 6 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
WordPress Plugins
Target version:
Start date:
2018-06-15
Due date:
% Done:

0%

Estimated time:

Description

Network-activated / mu-plugin widget will have a bit of explanatory language, along with a single-input search form and search button.

Form will submit GET request to CUNY OneSearch. URL format is https://onesearch.cuny.edu/primo-explore/search?query=any,contains,FOO&tab=default_tab&search_scope=everything&vid=CUNY&lang=en_US&offset=0, where FOO is the search term.

Note that vid=CUNY gives us the generic CUNY branding. We may one day decide to make this more fine-grained based on the campus affiliation of a site; see eg #9939. Or we could have a dropdown in the widget admin that allows the admin to select the branding. If we do this, it would make sense to have a centralized store of information about CUNY campuses.

Results should open in a new browser window.

Screenshot_2018-07-17_14-59-47.png (8.56 KB) Screenshot_2018-07-17_14-59-47.png Boone Gorges, 2018-07-17 04:03 PM
Screenshot_2018-07-17_14-59-36.png (19.2 KB) Screenshot_2018-07-17_14-59-36.png Boone Gorges, 2018-07-17 04:03 PM

Related issues

Related to CUNY Academic Commons - Feature #9939: Campus branding widgetResolved2018-06-15

History

#1 Updated by Boone Gorges 11 months ago

#2 Updated by Boone Gorges 11 months ago

Ray, we should come up with a scheme for all these network-available widgets. Should we maybe just have a widgets library in mu-plugins somewhere?

#3 Updated by Boone Gorges 11 months ago

  • Tracker changed from Support to Feature

#4 Updated by Boone Gorges 10 months ago

I've finished a first implementation. Relevant changesets:

https://github.com/cuny-academic-commons/cac/commit/233d6248d7fa4b13ecea9858a5987f9be819c793
https://github.com/cuny-academic-commons/cac/commit/9380d5e4645e5a1682669d1c2a0d5dd4d4a2a666
https://github.com/cuny-academic-commons/cac/commit/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b

First, for Ray, a couple of notes. (a) I started a central registry of CUNY campus information, which I can also use for #9939. In the future, we may want to extend this to cover xprofile fields, etc. https://github.com/cuny-academic-commons/cac/blob/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/cuny-campuses.php (b) I set up a simple infrastructure for sitewide widgets, but you should feel free to modify. See https://github.com/cuny-academic-commons/cac/blob/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/cac-functions.php#L46, https://github.com/cuny-academic-commons/cac/tree/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/widgets

Everyone else, see the attached screenshots for some visuals. As you can see, the Title and Description field are customizable. 'Campus' is a dropdown of all CUNY campuses; by default, none is selected. On the front end, when clicking Search, a new tab is launched that loads the OneSearch results corresponding to the entered search term; if a CUNY campus is set in the widget settings, that campus's visual settings are used, otherwise it's the generic CUNY branding. (SPS and SPH don't have their own branding, as far as I can see.) The OneSearch query syntax is a bit funky, which means that I have to assemble the query URL in JavaScript. When JS is not available, I've got a shim in place (the query is submitted to a subpage of the Commons, which translates it into a OneSearch query and then redirects to OneSearch).

There's only so much we can do to enforce styling across themes. IMO we should probably inherit most form styling (fields, buttons, etc) from the theme.

Feedback welcome on the following:
- Functionality/flow
- Wording/labels/default text
- General (ie cross-theme) styling

It's available for testing on cdev as well.

#5 Updated by Maura Smale 10 months ago

Boone Gorges wrote:

I've finished a first implementation. Relevant changesets:

https://github.com/cuny-academic-commons/cac/commit/233d6248d7fa4b13ecea9858a5987f9be819c793
https://github.com/cuny-academic-commons/cac/commit/9380d5e4645e5a1682669d1c2a0d5dd4d4a2a666
https://github.com/cuny-academic-commons/cac/commit/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b

First, for Ray, a couple of notes. (a) I started a central registry of CUNY campus information, which I can also use for #9939. In the future, we may want to extend this to cover xprofile fields, etc. https://github.com/cuny-academic-commons/cac/blob/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/cuny-campuses.php (b) I set up a simple infrastructure for sitewide widgets, but you should feel free to modify. See https://github.com/cuny-academic-commons/cac/blob/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/cac-functions.php#L46, https://github.com/cuny-academic-commons/cac/tree/06b6d3515dd2b171e2e2d6a270048f33b7ddd94b/wp-content/mu-plugins/widgets

Everyone else, see the attached screenshots for some visuals. As you can see, the Title and Description field are customizable. 'Campus' is a dropdown of all CUNY campuses; by default, none is selected. On the front end, when clicking Search, a new tab is launched that loads the OneSearch results corresponding to the entered search term; if a CUNY campus is set in the widget settings, that campus's visual settings are used, otherwise it's the generic CUNY branding. (SPS and SPH don't have their own branding, as far as I can see.) The OneSearch query syntax is a bit funky, which means that I have to assemble the query URL in JavaScript. When JS is not available, I've got a shim in place (the query is submitted to a subpage of the Commons, which translates it into a OneSearch query and then redirects to OneSearch).

There's only so much we can do to enforce styling across themes. IMO we should probably inherit most form styling (fields, buttons, etc) from the theme.

Feedback welcome on the following:
- Functionality/flow
- Wording/labels/default text
- General (ie cross-theme) styling

It's available for testing on cdev as well.

This looks great, and I think this will be super useful. I defer to others re: wording -- Stephen Francoeur in particular I know has been very involved in the conversations about wording that have happened since OneSearch launched. I know every campus is different, and he might have a sense of the wording that applies most broadly. Thanks!

#6 Updated by Boone Gorges 6 months ago

  • Status changed from Testing Required to Resolved

Also available in: Atom PDF