Skip to content

Links to the query builder

Kim Rutherford edited this page Jan 24, 2018 · 3 revisions

The queries links are defined in the "predefined_queries" section in the config file (pombe-embl/website/pombase_v2_config.json in SVN).

There is an HTML like syntax for adding these inline links to predefined queries. It's like this:

<app-query-link [goToResults]="true" [linkText]="'List of unknown genes'"
    [predefinedQueryName]="'priority-unstudied-genes:unknown_genes'">
</app-query-link>

Sorry it's so verbose. That can all be on one line if that's tidier.

These links can appear anywhere in the Markdown documentation including in the panels on the front page.

If the goToResults attribute is set to "false" the link will go to the query builder instead.

The linkText attribute is optional. If it's not specified the result count will be used as the link text. That's what we do on the priority unstudied genes page.

The predefinedQueryName attribute is required and must match the ID of an entry in the "predefined_queries" section of the config file.

Unfortunately value of the linkText and predefinedQueryName attribute need to be doubly-quoted, there have to be two nested sets of matching quotes, one double-quote and one single quote, like:

"'List of unknown genes'"

It's easy to forgot and the page won't load if it's forgotten. :-/

Annoyingly, the goToResults attribute shouldn't be doubly-quoted, so eg. [goToResults]="false"