👉Shortcode parameters
Shortcode parameters allow you to control both the product data output and the layout design in Content Egg. These parameters can be applied similarly for both module-specific and global shortcodes.
1. Data Filtering and Selection
limit
The limit
parameter controls how many items are displayed in the output. It restricts the product count to a specified number.
Display the first 5 products only:
offset
The offset
parameter skips a specified number of items before starting the output, allowing you to control where the product listing begins.
Combining limit with offset: If you want to show a specific subset of products (e.g., products 6 to 10), you can combine limit
with offset
:
next
The next
parameter is used to divide a product list into separate blocks, allowing you to display items in sequential batches. Each time you use the shortcode with the next parameter, it shows the next set of products.
Display the first two products:
Display the next four products after the first two:
Each time you increase the next
value or repeat the shortcode, the next set of items will be shown.
post_id
The post_id
parameter lets you display Content Egg data from one post in any other post, page, or widget. This is useful for reusing product data across your site without duplication.
modules
The modules
parameter allows you to specify which modules to pull data from by using module IDs, not the module names. You can find the correct module IDs in the Content Egg settings pages under the specific module configurations.
You can add as many module IDs as needed, separated by commas.
exclude_modules
Excludes certain modules from the output.
Example: To exclude Amazon from a price history graph, you can use the following shortcode:
sort
The sort
parameter sets the sorting criteria for products, with options: price
, discount
, reverse
, and total_price
.
Example:
This sorts products by the highest discount first.
For more detailed information on product sorting options, click here.
order
The order
parameter controls the sorting direction in sortable shortcodes, such as product lists. You can set it to either asc
(ascending) or desc
(descending).
Example:
By default, the sorting order is asc
(ascending).
products
Filter products output by product ID. Click on the "id
" button to add the product ID filter to the output shortcode. You can also set multiple IDs separated by commas.
groups
The groups
parameter filters data based on predefined product groups. This allows you to display only products that belong to specific groups, providing a way to categorize and organize product outputs.
Example: To display products from a specific group, use:
You can also display products from multiple groups by separating group names with commas.
For more details on how to set up and use groups, check the instructions here.
locale
The locale
parameter can be used only with the Amazon, eBay, and Shopee modules to filter products based on the selected country.
Example: To display US-based products from Amazon, use:
For details on integrating this with visitor geolocation plugins, please refer to the relevant documentation.
ean
The ean
parameter filters products by one or more EAN codes. It allows you to narrow down the output based on specific product EANs.
Example: To display products with specific EAN codes, use:
Please note, this parameter does not add new products; it only filters the existing products in the output.
remove_duplicates_by
The remove_duplicates_by
parameter removes duplicate products from the output by checking one of the specified product fields: orig_url
, url
, title
, ean
, or domain
. The module priority will determine which duplicate product to keep. This parameter can only be used with block shortcodes.
Example:
2. Data Changing:
currency
The currency
parameter allows you to convert all offers in your product list to a single currency, ensuring consistency when products come from different regions with varying currencies.
Example: To convert all offers to EUR:
If the desired currency is not listed, you can manually add an exchange rate by modifying the functions.php
file of your theme (or child theme) using a custom function like this:
Example (Adding a Custom Exchange Rate):
This allows you to manually set the conversion rate for any currency not natively supported by the plugin.
add_query_arg
The add_query_arg
parameter allows you to modify affiliate URLs by appending custom query variables to the URL. This can be useful for adding tracking parameters or custom tags to the affiliate links.
Example: To add a custom tag to Amazon affiliate URLs, use:
This appends the tag=CUSTOM_TAG
query variable to all Amazon product URLs, making it easy to customize the URL for tracking or other purposes.
keyword
The keyword
parameter allows you to create an auto-updated list of products by specifying a keyword. It works only with module shortcodes and automatically filters products based on the provided keyword.
Example: To display a list of Amazon products related to "Echo Dot":
You can also assign a custom group name by encoding the group separator ->
:
Additionally, you can control the maximum number of results using the limit
parameter:
The auto-update schedule and the maximum number of search results can be configured in each module's settings.
3. Template Output Customization
template
Defines the layout template used for displaying product data. Typically, you will set this parameter through the shortcode builder.
hide/visible
The hide
and visible
parameters allow you to control the display of specific elements in your product templates. Each template has default settings for what data is shown or hidden, but these parameters give you the flexibility to hide or force display certain fields.
hide
: Hides specified fields that would otherwise be shown.
visible
: Forces the display of fields that might be hidden by default.
Available Fields to Hide or Display:
badge
, button
, code
, coupons
,coupon_revival
, delivery_at_checkout
, description
, disclaimer
, domain
, endDate
, img
, logo
, merchant
, new_used_price
, number
, percentageSaved
, price
, priceOld
, price_update
, prime
, promo
, rating
, shipping_cost
, shop_info
, startDate
, stock_status
, subtitle
, title
Example to Hide Multiple Fields:
Example to Display Hidden Fields:
These parameters give you control over which product data elements are shown or hidden, allowing you to customize the look and feel of your product display.
btn_variant
Changes the button style, allowing you to choose from a variety of predefined styles such as solid or outlined versions of different color schemes. The available options are:
primary
, secondary
, success
, danger
, warning
, info
, light
, dark
, link
, outline-primary
, outline-secondary
, outline-success
, outline-danger
, outline-warning
, outline-info
, outline-light
, outline-dark
.
Note: btn_color
is an alias for btn_variant
.
You can also customize all the color themes for these styles (primary
, secondary
, etc.) in the Frontend settings
of Content Egg.
Example: To set a button with the outline-primary
style, use:
btn_text
Customizes the text displayed on buttons.
Example: To change the button text to "Check Price", use:
This will override the default button text and display "Check Price" on all buttons.
color_mode
Changes the color theme for the current block. The only available option is color_mode=dark
, which applies a dark theme to the block.
You can also set the Dark theme globally by going to Content Egg settings > Frontend > Color Mode.
Example:
cols
Controls the number of columns in grid
templates. You can also adjust the number of columns across different screen sizes using the parameters cols_xs
, cols_sm
, cols_md
, cols_lg
, cols_xl
, and cols_xxl
.
cols
is equivalent to cols_md
(medium screens).
Example:
To set a grid with 4 columns for medium screens and 2 columns for small screens:
This will display 4 columns on medium screens and 2 columns on smaller screens, allowing for a responsive layout.
img_ratio
Specifies the aspect ratio of the product images in the display. Allowed values are 1x1
, 4x3
, 16x9
, and 21x9
.
Example: To set the image aspect ratio to 16x9
, use:
title_tag
Sets the HTML tag for the product title. Allowed values are div
, h1
, h2
, h3
, h4
, h5
, and h6
.
Example: To set the product title as an h3
tag, use:
border
Adds a border to the product display. You can set the border width from 0 (no border) to 5 (thickest border) using this parameter.
Example: To add a border with a width of 3, use:
border_color
Specifies the color of the border. The allowed values are primary
, secondary
, success
, danger
, warning
, info
, light
, and dark
.
Example: To add a border with the danger
color, use:
tabs_type
Customizes the style of tabs for displaying products in templates that support tabs. The available options are:
tabs
: Standard tab style.pills
: Rounded "pill" style tabs.underline
: Tabs with an underline for the active tab.
Example: To display tabs in "pills" style, use:
cols_order
Changes the display order of columns in templates with multiple columns. You can specify the order of columns by listing their numbers in the desired sequence.
Example: To rearrange the columns in the order 3, 2, 1, 5, 4
, use:
This will display the third column first, followed by the second, and so on.
start_number
Specifies the starting number for product number badges. This is useful for listings where you want to start numbering from a specific value rather than 1.
Example: To start numbering products from 3, use:
This will make the list begin with number 3 for the first product.
title
Customizes or overrides the main title used in some templates.
Example:
show
The show
parameter is used only with "customizable
" block templates. It allows you to display specific information about a product, such as the price, title, button, etc. It's recommended to use this parameter in combination with the products
parameter to target specific product information.
Available Fields for show
:
button
, currencyCode
, img
, img+url
, last_update
, price
, priceOld
, stock_status
, title
, url
Example:
To display only the price of a specific product (ID: 808726894), use:
Low Price: Display the lowest price product:
High Price: Display the highest price product:
Customizing Templates with CSS:
Customizing templates with CSSLast updated