Recommended Change for Links Verticals: Set verticalLimit and Remove First/Last Page Buttons

Due to some limitations with Google Custom Search that have come to our attention, we have a few recommendations on how you configure your links vertical search (if you have one).

Remove the first and last button control

The page numbers from GCSE can be unreliable, making it difficult to guarantee that the first and last controls will work properly.

This can be done in your links config JSON file, in Pagination (under componentSettings)

JS version 1.4.0 or later: set showFirstAndLastButton to false:

"componentSettings": {
    "Pagination": {
       "showFirstAndLastButton": false
    },

Earlier than JS version 1.4.0: set showFirst and showLast to false

"componentSettings": {
    "Pagination": {
      "showFirst": false,
      "showLast": false,
    },

Set the verticalLimit to 10

GCSE can only reliably return 10 results at a time, per their documentation.
As a result, in your verticalsToConfig object for links, you’ll need to set the verticalLimit to 10 (it currently defaults to 20)

(Note that you can also set the universalLimit, however this variable is already capped at 10 so shouldn’t cause problems.)

More on the verticalLimit attribute can be found in this module.

2 Likes