Home » Shortcodes » Shortcodes (v1.2)

Shortcodes (v1.2)

There are 8 shortcodes available for Sabai Directory version 1.2. Note that currently these shortcodes can not be used together and can only be used once per page.

[sabai-directory]

Displays listings from one or more directories in list or map view with a search box, sorting options and pagination. Here are the attributes available for this shortcode:

  • perpage: The number of listings to display per page (default: “20”).
  • sort: The default sorting order, one of “newest”, “reviews”, “rating”, “distance”, or “title” (default: “newest”).
  • view: The default view mode, “list”, “map”, or “grid” (default: “list”).
  • zoom: The default zoom level of map (default: ’15”). Note that this will only apply when there is only 1 listing to be displayed. Otherwise, the zoom level is calculated automatically so that all listings fit within the map.
  • distance: The default search radius (default: “0”). Leave this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1” (default: “0”).
  • address: Display listings located near this address (default: none).
  • list_map_show: Whether or not to display a small map in list view, “0” or “1” (default: “1”).
  • list_map_height: The height of the map in pixels, when in list view (default: the value of map_height).
  • scroll_list: Show a scroll bar when there are many listings to display in list view, “0” or “1” (default: “1”). This is valid only when “list_map_show” is “1”.
  • hide_searchbox: Hide the search box form, “0” or “1” (default: “0”).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “0”).
  • hide_nav_views: Hide the view switcher, “0” or “1” (default: “0”). Note this will have no effect if hide_nav is “1”.
  • 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”).
  • geolocate: Use geolocation API to get the current user’s location and display nearby listings, “0” or “1” (default: “0”). This should be used in conjunction with the distance attribute for better search results.
  • 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.
  • search_location: Add this parameter with its value set to “0″ to disable location based search.
  • map_height: The height of the map in pixels (default: “500”).
  • map_style: The name of custom map style, one of “Red”, “Blue”, “Greyscale”, “Sepia”, “Mixed”, “Chilled”, or “Night” (default: none).
  • map_span: The horizontal display ratio (12 being 100% wide) of the map in list view, one of either “4”, “5”, “6”, “7”, or “8” (default: “5”).
  • map_marker_clusters: Whether or not to enable clustered markers on map, “0” or “1” (default: “1”).
  • 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”.

[sabai-directory-listings]

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

  • perpage: The number of listings to display per page (default: “10”).
  • sort: The default sorting order, one of “newest”, “reviews”, “rating”, “distance”, or “title” (default: “newest”).
  • distance: The default search radius (default: “0”). Leave this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1” (default: “0”).
  • address: Display listings located near this address (default: none).
  • 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”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Make featured listings sticky, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, 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.
  • 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”.

[sabai-directory-slider]

Displays listings from one or more directories in a slider:

  • perpage: The number of listings to display in the slider (default: “10”).
  • sort: The default sorting order, one of “newest”, “reviews”, “rating”, “distance”, or “title” (default: “newest”).
  • distance: The default search radius (default: “0”). Leave this to “0” for dynamic calculation based on the address being searched.
  • is_mile: Whether or not the value of distance is in mile, “0” or “1” (default: “0”).
  • address: Display listings located near this address (default: none).
  • hide_nav: Hide the navigation bar, “0” or “1” (default: “1”).
  • featured_only: Show featured listings only, “0” or “1” (default: “0”).
  • feature: Display featured listings first, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, 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.
  • slider_mode: Type of transition between slides, one of “horizontal”, “vertical”, or “fade” (default: “horizontal”)
  • slider_controls: Whether or not to display previous/next buttons (default: “1”).
  • slider_speed: Slide transition duration in milliseconds (default: “1000”).
  • slider_auto: Whether or not to enable auto transition of slides, “0” or “1” (default: “1”).
  • slider_auto_pause: The amount of time in milliseconds between each auto transition (default: “4000”).
  • slider_auto_hover: Whether or not to pause auto transition will when mouse hovers over slider, “0” or “1” (default: “1”).
  • slider_auto_controls: Whether or not to display auto start/pause buttons, “0” or “1” (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”.

[sabai-directory-map]

Displays a map of listings from one or more directories. Here are the attributes available for this shortcode:

  • num: The number of listings to display on map (default: “10”).
  • sort: The default sorting order, one of “newest”, “reviews”, “rating”, “distance”, or “title” (default: “newest”).
  • zoom: The default zoom level of map (default: “15”). Note that this will only apply when there is only 1 listing to be displayed. Otherwise, the zoom level is calculated automatically so that all listings fit within the map.
  • distance: The default search radius (default: “10”).
  • is_mile: Whether or not the value of distance is in mile, “0” or “1” (default: “0”).
  • address: Display listings located near this address (default: none).
  • width: The width of the map in pixels, leave empty for responsive width (default: none).
  • height: The height of the map in pixels (default: “400”).
  • style: The name of custom map style, one of “Red”, “Blue”, “Greyscale”, “Sepia”, “Mixed”, “Chilled”, or “Night” (default: none).
  • marker_clusters: Whether or not to enable clustered markers, “0” or “1” (default: “1”).
  • addons: If you have created multiple directories by cloning the Directory add-on, 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.
  • 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”.

[sabai-directory-categories]

Displays a list of categories from one or more directories. 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 categories from specific directories only. This must be add-on names (case sensitive) separated by commas (default: none).
  • columns: The number of columns of the category listing, one of either “1”, “2”, “3”, or “4” (default: “2”).
  • 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”.

[sabai-directory-search-form]

Displays a search listings 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 a directory created by the [sabai-directory] shortcode. If this parameter is set, the addon paramter will be ignored.
  • no_loc: Add this parameter with its value set to “1” to disable location based search.
  • 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”.
  • 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).

[[sabai-directory-add-listing-form]]

Displays an add listing form.

[sabai-directory-add-listing-button]

Displays an add listing button. 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 an add listing form created by the [[sabai-directory-add-listing-form]] shortcode. If this parameter is set, the addon paramter will be ignored.
  • size: Use this parameter to specify the size of the button, one of either “mini”, “small”, or “large” (default: none).
  • type: Use this parameter to specify the type of the button to display, one of either “primary”, “success”, “danger”, “warning”, or “inverse” (default: none).