Saving and Managing Auto-population Queries [Pro]

Knowledgebase Docs » Bellows
USEFUL? 0

Overview

As you set your parameters for auto-population queries, the shortcode will update to create the menu that you configure. If you leave this page and come back, all the settings will reset.

If you want to save this group of settings (known as a “query”, because these are the parameters we use to query to database for matching posts), then you can use the Save Query feature

Saved Queries have a unique ID that references a specific set of auto population settings, and can be referenced with the simpler shortcode

[bellows_menu qid="76"]

The advantage of Saved Queries

If you are only using a menu once, then the difference between a saved query menu and normal menu is minimal. For example, these two shortcodes might produce the same output:

[bellows_terms config_id="secondary" taxonomies="genre" orderby="id"]

[bellows_menu qid="76"]

The former is a normal auto-population menu using the bellows_terms shortcode, and the latter is a saved query auto-population menu using the bellows_menu shortcode, which retrieves the same parameters from the saved query.

The shortcodes produce the same menu, so what’s the difference?

Let’s say that you’re using the same menu on 3 different pages. So you are adding the same shortcode 3 times. You could use either shortcode above.

But now let’s say a week later you want to change to a new Configuration you’ve created. If you use the non-saved query, you need to go change the configuration in each of the 3 shortcode instances from

[bellows_terms config_id="secondary" taxonomies="genre" orderby="id"]

to

[bellows_terms config_id="new_config" taxonomies="genre" orderby="id"]

However, if you’re using a saved query, you can leave the same shortcode ([bellows_menu qid="76"]) in place. Just go back to the Code Generator and open up your Saved Query. Change the Configuration setting, re-save your Query, and the menu will automatically be updated.

Note that if you want to use an auto-populated menu via an accordion widget, you are required to use a Saved Query.

Saving a query

To save your query, enter a name for your query in the Save Query field and click Save Query

This will take your currently selected settings and save them as an entity that you can open, edit, and resave in the future.

To create more queries, click the dropdown arrow and click Create New Query to initialize a new query.

You can create as many queries as you like, and they will be listed in the dropdown.

Managing Queries

To manage your queries, click the dropdown arrow to reveal the list of saved queries. Note that queries are specific to their type (posts vs terms – Term queries will not appear in the Posts saved queries dropdown).

Beside each query are 4 action icons – hover to see their descriptions.

Open

Open this query for editing. It will set this query as the current query. Any changes currently in the editor will be overwritten with the settings from this query.

Save

Save the currently selected settings to this query, overwriting any existing settings for this query.

Reveal Code

With a saved query, you can use a special shortcode attribute that references the query. This keeps the code neater, and makes it simpler to update later. Click the Reveal Code toggle to show the shortcode and PHP code for that query.

Delete

Delete the query completely. Menus that rely on this query will no longer function properly.