Document finder template

The Document finder template turns a page into a searchable list of files from the media library, with the filters stacked in a left-hand column: a search box, an A to Z, a list of document types and a list of categories. It comes from the (Govintra) Media A to Z plugin, which must be installed and active before the template appears; see Enable the Document Finder and Media A to Z. It is normally applied to a page called “Documents” or “Forms” that is linked from the main menu. There is no Options setting for it; everything is on the page itself.

How it differs from the Media A to Z template

The plugin provides two templates that list exactly the same documents in the same way. The difference is the filters.

  • Document finder puts the filters in a column on the left, with every document type and every category visible at once as a list of links. The column takes the left quarter of the page on a desktop and sits above the results on a phone. Choose it when there are several types and categories and people browse as much as they search.
  • Media A to Z puts the filters in a row across the top, with document type and category as dropdown menus, so the results start higher up the page. Choose it for a smaller collection. See Media A to Z template.

One behaviour differs. On the Document finder, a search runs within whatever letter, type and category are already chosen. On the Media A to Z template, a search drops the letter.

Create the page

Go to Pages, then Add New, give the page a title such as “Documents”, and in the Page Attributes box set Template to Document finder; see Change a page layout. Once the page is saved, a Filters box appears below the editor. Anything typed in the editor appears under the page title, above the filters and the list: a line about what the page holds and who to ask about a missing document.

Filters box on the page

  • Show filters: tick which of Search, A to Z, Document type and Category to show in the column. At least one must be ticked. A new page shows all four.
  • Show page links: off by default. When on, each document also gets a link to the page it belongs to: the page it was uploaded from, and any page that lists it in its Document attachments box. The page is a little slower with this on.
  • Link text: shown once Show page links is on. The wording of that link. The default is “View in context”.

What the left-hand column shows

  • Search: a box and a button. It matches words in a file’s title, caption and description, using the standard WordPress search of the media library; it does not read inside the file. An empty search does nothing.
  • A to Z: All followed by the letters A to Z. A letter is a link only when an administrator has created it under Media, Media A to Z; the rest are greyed out. Only files given that letter are shown when it is chosen.
  • Document type: All and every document type from Media, Document types, in alphabetical order, including types with no files yet. The box does not appear until at least one type exists.
  • Category: All and each top-level category that already holds at least one file. Sub-categories are not offered. The box does not appear until a file has been put in a category.

The current choice in each box is highlighted. Choices combine: a letter, a type and a category together show only files that match all three, and a search then runs within them.

What the results show

Above the list, each active filter appears as a pill with a cross to remove it, together with Reset filters, which clears everything. A heading says All results when nothing is filtered, the number of results such as “12 results” when something is, or No results.

Files are listed in alphabetical order of title, 25 to a page, with page links below. Each line has an icon for the kind of file, the file’s title, and a label such as “(PDF)” or “(DOCX)” after it. Selecting the title opens or downloads the file itself. With Show page links on, a View in context link follows; where a file belongs to several pages, the link expands into a list of their names.

What a document needs to appear

Classification is done on the file’s full edit screen: go to Media, Library, open the file and select Edit more details. The steps are in Add documents to the document finder.

  • To be in the list when nobody has chosen a filter, a file needs a Document type or a top-level Category. A file with neither is found only by searching or by its letter, so give every document a type.
  • To be found through the A to Z, a file needs one or more Media A to Z letters ticked.
  • Its Title is what the list shows and sorts by, so replace a file name such as “HR-form-v3.docx” with “Flexible working request form”.

Any kind of file counts, including PDFs, Word and Excel documents, presentations and images. Contributors, authors and editors can classify files; only administrators can add document types and letters. When a form changes, replace the file rather than uploading a second copy: see Replace an existing document.

Related