diff --git a/README.md b/README.md
index cf9d273..f166ca9 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
A Jekyll based site for tutorials on customizing Blacklight applications.
+Publishes to:
+
## Authors
**Jessie Keck**
diff --git a/_includes/previous_next.html b/_includes/previous_next.html
index 6a81dbc..b4aa1f2 100644
--- a/_includes/previous_next.html
+++ b/_includes/previous_next.html
@@ -19,6 +19,9 @@
{% endif %}
+
+ For a list of pages in the tutorial, click the menu icon on the upper left.
+
{% else %}
{% assign page_index = page_index | plus: 1 %}
{% endif %}
diff --git a/v8.0.0.alpha/04-helper-method-overrides.md b/v8.0.0.alpha/04-helper-method-overrides.md
index b04f684..5093f68 100644
--- a/v8.0.0.alpha/04-helper-method-overrides.md
+++ b/v8.0.0.alpha/04-helper-method-overrides.md
@@ -6,7 +6,7 @@ redirect_from: /overrides/
blacklight_version: v8.0.0.alpha
---
-Much of Blacklight is written in a way that is overridable, helper methods are no different.
+Much of Blacklight is written in a way that is overridable. Helper methods are no different.
Let's take a look at the [module that is used to help with some of the layout for Blacklight](https://github.com/projectblacklight/blacklight/blob/master/app/helpers/blacklight/layout_helper_behavior.rb). This module is mixed into the `Blacklight::BlacklightHelperBehavior` which allows us to override methods mixed in.
@@ -41,7 +41,7 @@ module CustomLayoutHelper
end
{% endhighlight %}
-Now we are free to override methods to meet our custom application needs. For example, lets override the `html_tag_attributes` method.
+Now we are free to override methods to meet our custom application needs. For example, let's override the `html_tag_attributes` method.
{% highlight ruby %}
# app/helpers/custom_layout_helper.rb
@@ -66,5 +66,5 @@ This overridden method adds an additional attribute `dir="rtl"` to display our p
This is just one way that the Blacklight code can be overridden and customized. Similar patterns can be used to customize controllers and search behavior.
+ <%= link_to t("more_#{@facet_field.key}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: @facet_field.label),
+ @facet_field.modal_path,
+ data: { blacklight_modal: 'trigger' } %>
+
+ <% end %>
<% end %>
<% end %>
```
-and then make a nice visible change:
+and then make a nice visible change (the label disappears):
```diff
-<% component.with(:label) do %>
+ <% component.with_label do %>
- <%= @facet_field.label %>
+ -> <%= @facet_field.label %> <-
<% end %>
@@ -137,6 +152,7 @@ Blacklight uses the `Blacklight::SearchState` to map a user's query parameters t
Here, we'll map the language field to a single-valued `language` parameter instead of the default `f[format][]`:
```ruby
+# app/controllers/catalog_controller.rb
config.add_facet_field 'language_ssim', filter_class: SimpleFilterClass
```
@@ -166,7 +182,7 @@ class SimpleFilterClass < Blacklight::SearchState::FilterField
new_state.reset(params)
end
- # Facet values set int he URL
+ # Facet values set in the URL
def values(except: [])
Array(search_state.params[key])
end
@@ -184,7 +200,7 @@ end

@@ -15,6 +15,7 @@ Blacklight provides a UI element to choose a which "search fields" to execute th
If there aren't any search fields configured (or one default one like below) the `qt` parameter set in the Blacklight config's `default_solr_parameters` will be used and there will be no search field dropdown presented to the user.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_search_field 'all_fields', label: 'All Fields'
end
@@ -23,6 +24,7 @@ end
Adding an new search field to the dropdown can be accomplished by using the `add_search_field` configuration option. By default, the key passed to `add_search_field` will be passed to solr as the `qt` parameter. In the example below, this would use the `title` request handler by passing `qt=title` when querying solr (when the user chooses "Title" for the search field dropdown).
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_search_field 'all_fields', label: 'All Fields'
config.add_search_field 'title', label: 'Title'
@@ -32,6 +34,7 @@ end
It's possible to use a different request handler than the key passed to `add_search_field`. This way the `search_field` parameter in the application URL will remain `title` while the solr request handler that maps to remains know to the application configuration only (allowing you to change the request handler without breaking existing urls/bookmarks).
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_search_field 'all_fields', label: 'All Fields'
config.add_search_field 'title', label: 'Title' do |field|
@@ -43,6 +46,7 @@ end
A common pattern is to configure `solr_parameters` directly in the `add_search_field` configuration (and use the default search results handler). You will likely want to pass `qf` and `pf` values that are defined in your default request handler.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_search_field 'all_fields', label: 'All Fields'
config.add_search_field 'title', label: 'Title' do |field|
diff --git a/v8.0.0.alpha/13-sort-fields.md b/v8.0.0.alpha/13-sort-fields.md
index 5f5c7f8..5492070 100644
--- a/v8.0.0.alpha/13-sort-fields.md
+++ b/v8.0.0.alpha/13-sort-fields.md
@@ -15,6 +15,7 @@ Blacklight provides a UI element to choose a sort order for results when multipl
Sort options can be configured using the `add_sort_field` configuration method. The following configuration won't display because there is only one sort option to choose from.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_sort_field 'score desc', label: 'relevance'
end
@@ -23,6 +24,7 @@ end
Even though this will not display a sort option, it still controls the default sort behavior of search results. It's often useful to supply sub sorts, even for a default score based relevancy search result as facet based results will all have the same score. We can update the default sort of our results by updating the sort field configuration and adding pub date and title sub-sorts. With the configuration below a facet only search (or simply an empty query) will be returned sorted.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_sort_field 'score desc, pub_date_si desc, title_si asc', label: 'relevance'
end
@@ -31,6 +33,7 @@ end
Adding additional sort fields is relatively straight forward. As above with the relevancy sort, it is most likely a good idea to provide sub sorts so when documents have the same relevancy score they are sorted using other criteria.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_sort_field 'score desc, pub_date_si desc, title_si asc', label: 'relevance'
config.add_sort_field 'pub_date_si desc, title_si asc', label: 'year'
@@ -40,6 +43,7 @@ end
The first value passed to `add_sort_field` will be both the sort value sent to solr as well as the parameter sent through the application url. It's possible to obscure the solr fields and their sort direction from the url by passing a key as the first parameter and passing the sort configuration explicitly as the `sort` key.
```ruby
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
config.add_sort_field 'relevance', sort: 'score desc, pub_date_si desc, title_si asc', label: 'relevance'
config.add_sort_field 'year', sort: 'pub_date_si desc, title_si asc', label: 'year'
diff --git a/v8.0.0.alpha/14-solr-parameters.md b/v8.0.0.alpha/14-solr-parameters.md
index 98f0665..4423258 100644
--- a/v8.0.0.alpha/14-solr-parameters.md
+++ b/v8.0.0.alpha/14-solr-parameters.md
@@ -42,6 +42,7 @@ In development, it can be handy to see the stored fields for a document. While y
Note that this API is disabled by default, both to discourage coupling applications to the underlying Solr document format and to avoid leaking non-public information present in the document.
```ruby
+# app/controllers/catalog_controller.rb
## Should the raw solr document endpoint (e.g. /catalog/:id/raw) be enabled
config.raw_endpoint.enabled = true
```
@@ -51,6 +52,7 @@ config.raw_endpoint.enabled = true
We can add or change the default parameters sent to Solr in the `CatalogController`. In `./app/controllers/catalog_controller.rb`, we can see the default configuration sets the number of items per search result:
```ruby
+# app/controllers/catalog_controller.rb
## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters
config.default_solr_params = {
rows: 10
@@ -62,6 +64,7 @@ Try changing the value to 20.
We can also override behavior from the requestHandler. Try adding a `qf` parameter and tweaking the fields + weights:
```ruby
+# app/controllers/catalog_controller.rb
## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters
config.default_solr_params = {
rows: 20,
diff --git a/v8.0.0.alpha/15-thumbnails.md b/v8.0.0.alpha/15-thumbnails.md
index 20fd8b5..11c334a 100644
--- a/v8.0.0.alpha/15-thumbnails.md
+++ b/v8.0.0.alpha/15-thumbnails.md
@@ -49,6 +49,7 @@ end
Sometimes, not all documents have a thumbnail. In this case, you can configure a default thumbnail to be used for documents that don't have a thumbnail.
{% highlight ruby %}
+# app/controllers/catalog_controller.rb
config.index.default_thumbnail = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMTUwIiB2aWV3Qm94PSIwIDAgMzAwIDE1MCI-IDxyZWN0IGZpbGw9IiNkZGQiIHdpZHRoPSIzMDAiIGhlaWdodD0iMTUwIi8-IDx0ZXh0IGZpbGw9InJnYmEoMCwwLDAsMC41KSIgZm9udC1mYW1pbHk9Ikdlb3JnaWEsIHNlcmlmIiBmb250LXNpemU9IjMwIiBkeT0iMTAuNSIgZm9udC13ZWlnaHQ9Im5vcm1hbCIgeD0iNTAlIiB5PSI1MCUiIHRleHQtYW5jaG9yPSJtaWRkbGUiPjMwMMOXMTUwPC90ZXh0PiA8L3N2Zz4='
{% endhighlight%}
diff --git a/v8.0.0.alpha/18-extending-catalog-controller.md b/v8.0.0.alpha/18-extending-catalog-controller.md
index d950494..68c4c3d 100644
--- a/v8.0.0.alpha/18-extending-catalog-controller.md
+++ b/v8.0.0.alpha/18-extending-catalog-controller.md
@@ -14,14 +14,16 @@ First, we need to pull in the Blacklight configuration from the `CatalogControll
+ class StaticPagesController < CatalogController
```
-If we try to look at the home page now, we'll see a routing error (`ActionController::UrlGenerationError in StaticPages#home`). We'll also need to tell the `StaticPagesController` we want to use the catalog routes from `CatalogController` [^1]. By convention, Blacklight uses the `search_action_url` method to route to the correct place. We can override that in the controller:
+If we try to look at the home page now, we'll see a routing error (`ActionController::UrlGenerationError in StaticPages#home`). We'll also need to tell the `StaticPagesController` we want to use the catalog routes from `CatalogController`. By convention, Blacklight uses the `search_action_url` method to route to the correct place. Update routes.rb to give static_pages access to those routes.
```diff
-class StaticPagesController < CatalogController
-+ alias_method :search_action_url, :search_catalog_url
+# routes.rb
++ resource :static_pages, only: [:home], as: 'home', path: '/', controller: 'static_pages' do
++ concerns :searchable
++ end
```
-Next, we need to update the controller to make a solr query and store the result (again, by convention) in the instance variable `@response`. We can copy the way Blacklight does this for the [`CatalogController#index` action](https://github.com/projectblacklight/blacklight/blob/master/app/controllers/concerns/blacklight/catalog.rb#L27) [^2]:
+Next, we need to update the controller to make a solr query and store the result (again, by convention) in the instance variable `@response`. We can copy the way Blacklight does this for the [`CatalogController#index` action](https://github.com/projectblacklight/blacklight/blob/master/app/controllers/concerns/blacklight/catalog.rb#L27) [^1]:
```diff
class StaticPagesController < CatalogController
@@ -56,6 +58,4 @@ class StaticPagesController < CatalogController
-[^1]: We might want the opposite if we wanted our controller to be a specialization of `CatalogController` (perhaps providing a filtered "ebooks" view or an administration view with a specialized display and tooling). If we wanted to do that, we'd add search routing to the controller in `./config/routes.rb`.
-
-[^2]: This index method does a little more than we need to do to add a few facets. Note, too, the `deprecated_document_list` argument coming back from the search service; in Blacklight 8, this method will return only the response.
+[^1]: This index method does a little more than we need to do to add a few facets. Note, too, the `deprecated_document_list` argument coming back from the search service; in Blacklight 8, this method will return only the response.
diff --git a/v8.0.0.alpha/20-other-plugins.md b/v8.0.0.alpha/20-other-plugins.md
index eb3dab5..f8977d0 100644
--- a/v8.0.0.alpha/20-other-plugins.md
+++ b/v8.0.0.alpha/20-other-plugins.md
@@ -22,5 +22,5 @@ These types of plugins provide a specific type of Blacklight application experie
Blacklight plugins exist as separate software projects, and can even have adjacent communities that help maintain them.
diff --git a/v8.0.0.alpha/21-apis.md b/v8.0.0.alpha/21-apis.md
index ac97fd7..4a58f1e 100644
--- a/v8.0.0.alpha/21-apis.md
+++ b/v8.0.0.alpha/21-apis.md
@@ -56,7 +56,6 @@ http://127.0.0.1:3000/catalog/00282214.marcjson
### Search results
-In addition to
You can also affect which search results response formats are available, in addition to the out-of-the-box HTML, JSON, Atom and RSS feeds. Take a look at, e.g.:
- [http://127.0.0.1:3000/catalog?search_field=all_fields&q=&format=marc](http://127.0.0.1:3000/catalog?search_field=all_fields&q=&format=marc)
@@ -69,6 +68,7 @@ Note that this can be used in combination with any search query, facets, or sort
To add a different API format, you can instruct Blacklight to provide alternative results. In `app/controllers/catalog_controller.rb`, add:
```diff
+# app/controllers/catalog_controller.rb
configure_blacklight do |config|
+ config.index.respond_to.csv = true
end