JReviews logo Docs
Menu
Version

Shortcodes

Shortcodes are a great way to show JReviews content anywhere on your site. In other Joomla components and WordPress plugins, banner custom fields and even in your template customizations.

Overview

Shortcodes are another way to surface JReviews content on the site, in addition to Joomla modules, WordPress widgets, detail page related listing widgets, and custom embed options.

The modern [jreviews] rendering engine is gated behind the Shortcodes Early Access feature (Configuration → Early Access Settings). When it is off (the default), shortcodes use the legacy renderer and the older behavior. When it is on, they render through the modern engine — modern card layouts, the new layout and override attributes, and per-field Show Title support — and an admin Shortcode Preview page (Control Panel → Shortcode Preview) shows a live gallery of every shortcode type where you can see the output and copy ready-made examples.

Advanced-query boundary
Neither the legacy nor the modern Listings and Reviews shortcodes run a saved JSON Custom Query; that stays a trusted control-panel feature. To surface a query-driven layout, render a saved Site Widget with the Site Widget shortcode; its Listings, Comments, Media, or Calendar widget can use the saved JSON Custom Query.

The following shortcode types are available at this time:

Listings Shortcode

The listings shortcode uses the same query and card layouts as the JReviews listings Joomla module and WordPress widget. Below you can find a few examples of how to use it:

Single listing with an alias "westville-east"

[jreviews type="listings" listing_alias="westville-east" summary="1"]

Custom Search Params provide a simple way to filter listings by available search parameters.

All listings that have the keyword "Apple"

[jreviews type="listings" custom_params="keywords=Apple"]

All event listings in the next 7 days

[jreviews type="listings" custom_params="jr_eventdate=+7"]

For multi-option custom fields, the legacy default requires every selected value. Add usematch=1 to make those fields match any selected value. Add matchall[field_name]=1 for an individual field that should keep all-match behavior.

[jreviews type="listings" custom_params="usematch=1&jr_keywords=giraffe_gambling"]
[jreviews type="listings" custom_params="usematch=1&matchall[jr_keywords]=1&jr_keywords=giraffe_gambling"]
Raw SQL is never accepted
The custom_where and custom_order parameters are not usable from a shortcode. They are stripped for security in both the legacy and modern engines. Use custom_params, the filter_* attributes, and listing_order to refine and sort results instead.

10 top rated listings

[jreviews type="listings" listing_order="rating" columns="2" limit="10" show_numbers="1"]

Latest listings filtered by category

[jreviews type="listings" listing_order="rdate" category="23" limit="6"]

Listings in proximity to current listing

When used in the listing detail page, it will auto-detect the current listing's location.

[jreviews type="listings" listing_order="proximity" radius="10" limit="6"]

Listings in proximity to custom coordinates

[jreviews type="listings" listing_order="proximity_custom" radius="50" custom_lat="42.3600825" custom_lon="-71.0588801" limit="6"]
Proximity needs the Maps add-on config
Proximity ordering uses the geographic coordinate fields configured by the Maps / GeoMaps add-on. Without that configuration (or without resolvable coordinates) the shortcode gracefully falls back to the normal ordering instead of sorting by distance.

Choosing the display

Cards are always fixed-width and container-responsive: JReviews fits as many across as the available width allows and never crams them. You control two things, how wide each card is and how the row of cards is arranged:

  • How wide is each card? card_width sets a card width: sm (224px), md (256px), lg (288px), or xl (384px). Leave it off (or card_width="") to keep the width that comes with the layout. Cards never shrink below the width you pick; the grid just fits fewer across on a narrow screen. (card_size also works.)
  • Fixed or sliding? Add slider="1" to slide the cards horizontally; leave it off for a fixed grid.
  • A single row or a grid? rows="1" (the default) keeps a single row; rows="2" or more makes a grid that many rows tall. Inside the slider, rows="2" or more becomes a sliding grid that scrolls sideways.
Display Shortcode
Fixed responsive grid (layout's default width) [jreviews type="listings" limit="12"]
Wider cards, fixed grid [jreviews type="listings" card_width="lg" limit="12"]
Fixed grid, at most N columns [jreviews type="listings" columns="3" limit="12"]
Single-row slider [jreviews type="listings" slider="1" limit="12"]
Sliding grid [jreviews type="listings" slider="1" rows="2" limit="12"]

Use columns to cap how many columns the fixed grid can grow to (the default fits as many as the width allows); it has no effect on the slider. limit sets how many listings to load. Add limit_mobile to load fewer on phones; omit it to use limit on every screen. The modern listings render does not page, so the slider simply shows what fits and you scroll through the rest.

Same controls on the listings Site Widget
The same display controls (Card Width, Rows, Max columns, and the slider toggle) are available on the listings Site Widget settings under Display > Layout, so a saved widget and a shortcode arrange their cards the same way. In the widget settings the cap is labelled "Max columns"; the shortcode attribute for it is columns. Number of listings on phones is the widget equivalent of limit_mobile.

Listings Layouts

Under the modern engine the themelayout attribute resolves in this order:

  1. A built-in layout preset, referenced by its readable id: list-item, vertical, horizontal, postcard, poster, or vertical-masonry.
  2. A saved custom layout, referenced by its id from the Layout Customizer. Custom layouts are matched by id only (not by name), and the id match is case-sensitive.
  3. If the value matches neither, JReviews falls back to the default list-item layout. Logged-in administrators and editors (and the CP Shortcode Preview) see an inline "layout not found" notice; regular visitors just get the default layout with no message.
[jreviews type="listings" themelayout="postcard" columns="3" limit="6"]
Bare shortcode default
A bare [jreviews type="listings"] with no themelayout and no presentation attributes uses a legacy-compatible profile over the list-item layout: the category and both the editor and user ratings are shown, and the summary is hidden. Naming a layout or setting any presentation attribute turns this off and lets your layout and attributes win.

Listings Shortcode Attributes

Selection attributes (which listings to show):

Parameter Example Description
listing_alias listing_alias="westville-east" Alias of a specific listing (comma-separate several)
listing listing="51" Listing IDs (aliases: listing_id, listing_ids)
category category="22" Category IDs (alias: cat)
dir dir="1" Directory IDs
criteria criteria="3" Listing type IDs
user user="mine" "mine" - logged in user, integer - specific user id (alias: owner)
extension extension="com_easysocial" Default is com_content for native JReviews listings. To retrieve a listing included via the Everywhere Add-on, specify the extension name here.
listing_order listing_order="rating" Available options: rdate, date, updated, alpha, rating, rrating, editor_rating, reditor_rating, reviews, rhits, featured, random, featuredrandom, proximity, proximity_custom. Custom-field sorting is also supported with jr_fieldname (asc) / -jr_fieldname (desc)
limit limit="6" How many listings to load (1-100; alias: total). The listings render does not page: in a slider you scroll through the rest. When both limit and total are set, limit wins
limit_mobile limit_mobile="4" How many listings to load on phones (1-100). Omit or leave blank to use limit on every screen (alias: module_limit_mobile)
cat_auto cat_auto="0" 0 - disabled, 1 - enabled. Auto-detect the current category
hide_empty hide_empty="1" 0 - disabled, 1 - enabled. Hide the output when there are no results
featured featured="1" 0 - disabled, 1 - enabled. Featured listings only
custom_params custom_params="cat=24&keywords=boston" Search parameters (keywords, custom fields, dates)
filter_listing_period filter_listing_period="30" Only listings created in the last N days
filter_review_period filter_review_period="30" Only listings with at least one review in the last N days
filter_review_count filter_review_count="5" Minimum number of user reviews
filter_avg_rating filter_avg_rating="4" Minimum average user rating
radius radius="10" Proximity radius (used with a proximity listing_order)
custom_lat custom_lat="42.36" Center latitude for proximity_custom
custom_lon custom_lon="-71.05" Center longitude for proximity_custom

Display and layout attributes (how the listings look). The first four control how the cards are arranged (see Choosing the display); themelayout and the rest each override the corresponding setting of the resolved themelayout:

Parameter Example Description
card_width card_width="lg" Card width: sm (224px), md (256px), lg (288px), xl (384px). Omit or "" keeps the width that comes with the layout. Cards never shrink below this; the grid fits fewer across on narrow screens (alias: card_size)
slider slider="1" 0 - disabled, 1 - enabled. Slide the cards horizontally instead of a fixed grid
rows rows="1" How many rows tall the grid is (1-4, default 1). In the slider, rows="2" or more is a sliding grid
columns columns="3" Maximum number of columns for the fixed grid (1-6). The grid fits as many cards as the width allows up to this cap; it has no effect on the slider. columns no longer sets a card size (use card_width), and with columns greater than 1 and no themelayout the vertical card layout is used
themelayout themelayout="postcard" Layout preset id or saved custom-layout id (see Listings Layouts)
grid_gap grid_gap="4" Gap between cards in the grid
image_aspect image_aspect="1x1" Available options: 2x3, 4x5, 1x1, 6x5, 4x3, 7x5, 6x4, 8x5, 16x9
image_fit image_fit="cover" Available options: cover, contain
image_position image_position="left" Available options: top, left
image_width image_width="md" Available options: xs, sm, md, lg, xl
show_category show_category="1" 0 - disabled, 1 - enabled
show_author show_author="0" 0 - disabled, 1 - enabled
show_date show_date="0" 0 - disabled, 1 - enabled
user_rating user_rating="1" 0 - disabled, 1 - enabled (alias: show_user_rating)
editor_rating editor_rating="0" 0 - disabled, 1 - enabled (alias: show_editor_rating)
summary summary="1" 0 - disabled, 1 - enabled (alias: show_summary)
summary_words summary_words="20" Number of summary words (alias: summary_limit)
fields fields="jr_state,jr_city" Comma separated list of custom fields to show. Each field honors its own Show Title setting
compare compare="1" 0 - disabled, 1 - enabled. Show the compare control
show_numbers show_numbers="0" 0 - disabled, 1 - enabled
truncate_title truncate_title="1" 0 - disabled, 1 - enabled
truncate_abstract truncate_abstract="3" Number of summary lines to keep
show_icons show_icons="1" 0 - disabled, 1 - enabled
masonry masonry="1" 0 - disabled, 1 - enabled
border_radius border_radius="lg" Card border radius token
min_height min_height="200" Minimum card height in pixels
More layout overrides
Every layout setting can be overridden inline with its snake_case name. show_thumbnail is also accepted for forward compatibility, but the listings card always renders its media area, so it currently has no visible effect.

Deprecated Listings Attributes

Deprecated thumbnail and layout attributes
The pixel-based thumbnail attributes and the legacy layout suffixes below are deprecated under the modern engine. They are still honored and auto-mapped onto the new attributes so existing shortcodes keep working, but you should prefer the new attributes going forward.
Deprecated Maps to Notes
tn_size="100x100" image_aspect (+ image_width) Pixel size mapped to the nearest aspect bucket and width token
tn_width / tn_height image_aspect / image_width
tn_mode="scale" image_fit crop → cover, scale → contain
tn_position image_position
tn_show show_thumbnail Currently no visible effect on the listings card
tmpl_suffix="_vertical" themelayout="vertical"
orientation="horizontal" (with columns="1") themelayout="list-item"
orientation="slideshow" / tmpl_suffix="_slideshow" slider Renders the default layout inside a horizontal slider
themelayout="minimal" / "blogview" / "thumbview" / "masonry" list-item / horizontal / vertical / vertical-masonry Legacy layout names auto-map to the matching preset (no not-found notice)
Geotargeting proximity is not yet supported
listing_order="proximity_geotargeting" (ordering by the visitor's IP-based location) is not supported by the modern engine; it requires the Maps add-on's IP geolocation. When used, it gracefully falls back to the normal ordering. Use proximity (current listing) or proximity_custom (fixed coordinates) instead.

Reviews Shortcode

Below you can find some usage examples for the reviews shortcode.

Reviews for a single listing with alias "westville-east"

[jreviews type="reviews" listing_alias="westville-east" link_title="{review_title}" show_comments="1"]

10 most helpful user reviews

[jreviews type="reviews" reviews_order="helpful" reviews_type="user" limit="10"]

Latest reviews

[jreviews type="reviews" reviews_order="latest" limit="6"]
Bare shortcode default
A bare [jreviews type="reviews"] keeps the legacy-compatible default: the review body text is hidden, so each review shows the rating, the review title, and a link to the listing. Add show_comments="1" to include the body text.
Thumbnail sizing no longer applies to reviews
The review card has a fixed layout, so the legacy tn_size / tn_mode / tn_position attributes have no effect on the modern reviews shortcode. Use show_listing_thumbnail to show or hide the listing thumbnail.

Reviews show as a fixed grid by default. Add slider="1" to slide them sideways instead, and slider_mobile="1" to do the same on phones. Use card_width for how wide each review card is, columns to cap how many fit across, and rows for a sliding grid that is several rows tall. These are the same display controls as the listings shortcode.

Reviews Shortcode Attributes

There are many attributes you can use to customize the output of the reviews shortcode:

Parameter Example Description
listing_alias listing_alias="westville-east" Alias of a specific listing
listing listing="51" Listing IDs (aliases: listing_id, listing_ids)
category category="22" Category IDs (alias: cat)
dir dir="1" Directory IDs
criteria criteria="3" Listing type IDs
user user="mine" "mine" - logged in user, integer - specific user id (alias: owner)
extension extension="com_jreviews" Name of the extension from which reviews will be displayed
reviews_order reviews_order="latest" Available options: latest, helpful, random
reviews_type reviews_type="all" Available options: all, user, editor
show_comments show_comments="1" 0 - disabled, 1 - enabled. Show the review body text (hidden by default)
comments_words comments_words="10" Number of body-text words to show
show_rating show_rating="1" 0 - disabled, 1 - enabled
show_author show_author="1" 0 - disabled, 1 - enabled (alias: show_reviewer)
show_date show_date="1" 0 - disabled, 1 - enabled
review_link review_link="1" 0 - disabled, 1 - enabled. Link to the listing (alias: show_listing_title)
link_comment link_comment="1" 0 - disabled, 1 - enabled. Link the review title to the review
link_title link_title="{review_title}" Legacy heading template. The {listing_title} and {review_title} tokens map to the toggles above (show the listing-title link and link the review title, respectively). The {listing_title N} character-truncation form is not honored
show_listing_thumbnail show_listing_thumbnail="0" 0 - disabled, 1 - enabled. Shows the listing's main photo beside the review's listing title. On by default (as in JReviews 5); set to 0 to hide it. Needs the listing title shown and a listing that has a main photo
fields fields="jr_pros,jr_cons" Comma separated list of review custom fields to show. Each field honors its own Show Title setting
min_rating min_rating="4" Minimum review rating
comment_period_days comment_period_days="30" Only reviews from the last N days
card_width card_width="lg" Review card width: sm (224px), md (256px), lg (288px), xl (384px). Default sm; an unknown value is ignored. Cards never shrink below this; the grid fits fewer across on narrow screens (alias: card_size)
slider slider="1" 0 - disabled, 1 - enabled. Slide the reviews sideways instead of a fixed grid
slider_mobile slider_mobile="1" 0 - disabled, 1 - enabled. Slider on phones (set separately from slider)
columns columns="3" Maximum number of columns for the fixed grid (1-6). Fits as many across as the width allows up to this cap; no effect on the slider
rows rows="1" How many rows tall the grid is (1-4, default 1). In the slider, rows="2" or more is a sliding grid
template_suffix template_suffix="_vertical" Template variation (legacy alias: tmpl_suffix)
limit limit="10" Max. number of results (alias: total)
limit_mobile limit_mobile="4" How many reviews to load on phones. Omit or leave blank to use limit on every screen (alias: module_limit_mobile)
cat_auto cat_auto="0" 0 - disabled, 1 - enabled. Auto-detect the current category
hide_empty hide_empty="1" 0 - disabled, 1 - enabled. Hide the output when there are no results

Field Shortcode

The Field shortcode can show the output of a single field from any listing anywhere on the site. The shortcode format is:

[jreviews type="field" name="jr_state" listing_alias="blue-hill"]
[jreviews type="field" name="jr_state" listing_id="111"]

You can specify the listing for which you want to show the field using the listing_alias or listing_id attributes.

Under the modern engine the field output honors the field's per-field Show Title setting automatically, so a field configured to hide its title renders just the value.

You can also omit the listing attributes and the shortcode will try to auto-detect the listing from the current page (listing detail, view all reviews for a listing or review discussion pages). If a valid page cannot be auto-detected, the shortcode is removed and the output suppressed.

Auto-detection depends on modern detail rendering
The no-listing auto-detection works on pages rendered by the modern listing detail engine (the Listing Detail Early Access feature), which is what exposes the current listing to the shortcode. If your detail pages still render with the legacy engine, or if you are in any doubt, pass the listing explicitly with listing_id / listing_alias.

If you place the shortcode in a template file, you can combine it with custom PHP code. For example, in an event listing type, you can inject the venue related listing ID into the listing_id attribute to show venue custom fields in the event page.

Show venue address in event page

<?php if (isset($listing['Field']['pairs']['jr_venue'])): ?>

  [jreviews type="field" name="jr_address" listing_id="<?php echo $listing['Field']['pairs']['jr_venue']['real_value'][0];?>"]

<?php endif;?>

Manage Listing

Since JReviews v3.12.0

The Manage Listing shortcode can show the listing manage dropdown. When placed anywhere within the listing detail page, the shortcode code format is:

[jreviews type="manage_listing"]

It's also possible to disable the dropdown and instead show a plain list of options:

[jreviews type="manage_listing" dropdown="0"]

When using the shortcode outside the listing detail page, it's necessary to indicate to the shortcode which listing the dropdown is for. To do this, pass the corresponding listing ID in the listing attribute.

[jreviews type="manage_listing" listing="23"]

Listing Cover

Since JReviews v3.13.3/v4.0.9

The listing cover shortcode allows displaying the listing cover in the listing detail page outside of the JReviews output. For example, in a Joomla module or WordPress widget.

[jreviews type="listing_cover" class="fwd-w-full fwd-h-96 fwd-object-cover"]

The shortcode allows using the class and style attributes to pass CSS classes and custom CSS styles so you can customize the output as needed.

Listing Favorites

Since JReviews v4.3.0

The Listing Favorites shortcode can show the favorites add/remove button. When placed anywhere within the listing detail page, the shortcode code format is:

[jreviews type="listing_favorites"]

When using the shortcode outside the listing detail page, it's necessary to indicate to the shortcode which listing the dropdown is for. To do this, pass the corresponding listing ID in the listing attribute.

[jreviews type="listing_favorites" listing="23"]

Listing MyLists

Since JReviews v4.3.0

The Listing MyLists shortcode can show the MyLists add-to-list button. This type is provided by the MyLists add-on (it is not a core shortcode type), so it is available when that add-on is installed. When placed anywhere within the listing detail page, the shortcode code format is:

[jreviews type="listing_mylists"]

When using the shortcode outside the listing detail page, it's necessary to indicate to the shortcode which listing the dropdown is for. To do this, pass the corresponding listing ID in the listing attribute.

[jreviews type="listing_mylists" listing="23"]