INN / umbrella-energynewsnetwork

Umbrella repository for the Energy News Network site, a project of Fresh Energy
https://energynews.us
GNU General Public License v2.0
0 stars 1 forks source link

Add search bar to digest page and search results page #77

Open MirandaEcho opened 4 years ago

MirandaEcho commented 4 years ago

Custom form search for digest page, with date pickers, region picker.

benlk commented 4 years ago

From discussion in https://innorg.slack.com/archives/G0W8T58CQ/p1581009729002400 regarding the mockup in that message:

benlk commented 4 years ago

Known parts of this:

benlk commented 4 years ago

For unknown reasons, creating a sidebar named "Digest Sidebar" in Theme Options > Layout > Sidebar Options, and saving that sidebar in the sidebar picker at Posts > Categories > "Digests" > edit > Archive Sidebar, results in that sidebar not being found by the elaborate fallback queue in sidebar.php, and as a result the sidebar is not output.

The value that is saved in that sidebar's term meta post is:

$ wp post meta list  615232
+---------+----------------+----------------+
| post_id | meta_key       | meta_value     |
+---------+----------------+----------------+
| 615232  | custom_sidebar | digest-sidebar |
+---------+----------------+----------------+

wp sidebar list shows that the sidebar ID is digest-sidebar with a Name of "Digest Sidebar".

If this isn't solveable, we can hardcode it later. 🤷‍♂

Back to the search query research.

benlk commented 4 years ago

Screen Shot 2020-02-07 at 15 30 50

A QA thing that may come up later: Right now these are checkboxes, so that we can search for digests in more than one region. But during testing, I haven't seen any in more than one region. Is it okay to leave these as checkboxes, or should we swap to radio inputs for this field?

MirandaEcho commented 4 years ago

Checkboxes are fine. Use case: I'm a user interested in stories just in the Midwest but also Nationally, and would like to see a list with both.

benlk commented 4 years ago

Should this be an AND or an OR search? Right now it's AND, and will only show articles at the overlap of the Midwest and National regions, which as of this morning are a total of 0 posts.

MirandaEcho commented 4 years ago

How complex is the switch?

benlk commented 4 years ago

~5 minutes to add 'relation' => 'OR', to an array.

MirandaEcho commented 4 years ago

Please go ahead with that, thanks @benlk !!

benlk commented 4 years ago

Screen Shot 2020-02-07 at 18 41 10

Present styles.

benlk commented 4 years ago

Date range.

benlk commented 4 years ago

Is this issue obsoleted by #86?

MirandaEcho commented 4 years ago

86 specifies adding it to the actual pages, if not done already.

benlk commented 4 years ago

The search form was added in PR #83, which is merged, but not yet deployed to https://usenergystage.wpengine.com/category/digest/