diff --git a/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php b/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php index 4bdda903..7423605c 100644 --- a/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php +++ b/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php @@ -119,6 +119,13 @@ public function widget( $args, $instance ) { if ( $instance['targets'] == 'use' ) { + // Determine whether to enable NLS based on widget settings and the user's cookie. + $nls_enabled = $this->readCookie( $instance['nls_default'] ); + + $nls_link_toggle = $this->setToggleValue( $nls_enabled ); + + $nls_included = $instance['nls_included']; + echo '
'; include( $all_template ); echo '
'; @@ -162,6 +169,11 @@ public function form( $instance ) { if ( '' == $instance['bento_url'] ) { $bento_url = 'https://lib.mit.edu/'; } + $nls_default = $instance['nls_default']; + if ( '' == $instance['nls_default'] ) { + $nls_default = 'off'; + } + $nls_included = $instance['nls_included']; ?>

+

Natural language search

+

+ Should the natural language option be shown?
+ +

+

Which is the default query mode?

+ +
Advanced search | More ways to search -
- Try natural language search - Learn more -
+ +
+ Natural language search + Learn more +
+