Home » Shortcodes

Shortcodes

Below are the shortcodes available with the plugin.

[sabai-discuss]

Displays questions from one or more question sections with a search box, sorting options and pagination. Here are the attributes available for this shortcode:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display per page.
  • sort: The default sorting order, one of “newest”, “oldest”, “random”, or “title”.
  • hide_searchbox: Hide the search box form, “0” or “1” (default: “0”).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Make featured listings sticky, “0” or “1” (default: “1”).
  • addons: If there are multiple directories, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • user_id: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • keywords: Show questions containing keyword(s) specified with this parameter
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-discuss-questions]

Displays questions from one or more directories in list view with optional sorting options and pagination. This shortcode is essentially the same as the [sabai-discuss] but without the searchbox. Here are the attributes available for this shortcode:

  • addon: When set, the settings of the specified add-on will be used as the default settings of this shortcode (default: if addons is set, the first value specified, otherwise “Directory”).
  • perpage: The number of listings to display per page.
  • sort: The default sorting order, one of “newest”, “oldest”, “random”, or “title”.
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “0”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Make featured listings sticky, “0” or “1” (default: “1”).
  • addons: If there are multiple directories, use this parameter to display listings from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • category: Display listings that belong to this category and its descendant categories (default: none). The value must be a valid category slug. If there are multiple directories, use the addons attribute to specify the directory to which the category belongs, otherwise the default directory will be used.
  • user_id: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • keywords: Show questions containing keyword(s) specified with this parameter
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-discuss-answers]

Displays answers from one or more qusetion sections in list view with optional sorting options and pagination. Here are the attributes available for this shortcode:

  • hide_nav: Hide the navigation bar, “0” or “1” (default: “1”).
  • hide_pager: Hide the page navigation at the bottom, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display reviews from specific directories only, otherwise reviews from all add-ons will be shown. This must be add-on names (case sensitive) separated by commas (default: none).
  • user_id: When this parameter is set, then only the reviews submitted by the user will be shown (default: none).
  • user_name: When this parameter is set, then only the listings claimed or authored (and unclaimed) by the user will be shown (default: none, overrides: user_id).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-discuss-favorites]

Displays favorite questions and answers of a user from one or more qusetion sections in list view with optional sorting options and pagination. Here are the attributes available for this shortcode:

  • addons: If you have created multiple directories by cloning the Directory add-on, use this parameter to display reviews from specific directories only, otherwise reviews from all add-ons will be shown. This must be add-on names (case sensitive) separated by commas (default: none).
  • user_id: Questions or answers favorited by the user will be show (default: none).
  • user_name: Questions or answers favorited by the user will be shown (default: none, overrides: user_id).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example

[sabai-discuss-search-form]

Displays a search questions form. Here are the attributes available for this shortcode:

  • addon: If you have created multiple directories by cloning the Directory add-on, use this parameter in order to specify to which directory the search form will be submitted. If no value is given, then it will be submitted to the default directory. This must be a valid add-on name (case sensitive, default: none).
  • page: Use this parameter to specify the page to which the search form will be submitted. This can be either the slug (path) or the ID of the page. Make sure that the content of the page contains content created by the [sabai-discuss] shortcode. If this parameter is set, the addon paramter will be ignored.
  • no_key: Add this parameter with its value set to “1” to hide the input keyword field in the search form.
  • no_cat: Add this parameter with its value set to “1” to hide the category dropdown field in the search form.
  • button: Use this parameter to specify the color of the button to display, one of either “sabai-btn-primary”, “sabai-btn-success”, “sabai-btn-danger”, “sabai-btn-warning”, or “sabai-btn-inverse” (default: none).
  • mini: Setting this to “1” will then render all fields in the form 100% width. This is great for displaying the form in the sidebar for example, where the space for displaying the form is limited (default: 0).
  • return: If you are using the shortcode outside the page content, e.g., in your theme or in widgets, make sure to add this parameter with its value set to “1”.

Example