Data Attributes
These are the other
data-*
attributes that can be passed to an HTML element with a data-widget
prop.Attributes marked as “required” need to be provided, otherwise the widget will error.
Specifies the websocket/http address to a fallback ETH node. Used when initiating the EthereumProvider for the widgets. We fallback to the specified address when the widget is loaded:
- 1.On a browser with no wallet (incognito browsing mode for example).
- 2.On Mac's Safari.
- 3.On a mobile device for all cases except when navigating with a built-in browser within the MetaMask app.
Set this value to
wss://mainnet.infura.io/ws/v3/YOURAPIKEY
(for mainnet) or wss://goerli.infura.io/ws/v3/YOURAPIKEY
to ensure that the listing details can read from an accurate link without depending on an external Ethereum provider's network.[Updated name] In versions < 3.0.0:
data-key
.A string identifier given to the widget. If this data attribute exists on the HTML element and is a non-empty string, the element will emit a
m-marketplace_widget_injected
event when it has been replaced in the DOM tree.Supported in CDN version: >= 3.3.0.
Specifies to which platform a listing will link out. Accepts one of the following string values:
"blur"
: links to the token's Blur page (only available for Ethereum Mainnet);"looksrare"
: links to the token's LooksRare page;"opensea"
: links to the token's OpenSea page;"rarible":
links to the token's Rarirble page.
Data attributes that relate to the minting process.
A URL to a CSV file used when the listing type is a fixed or variable price purchase. Limits the number of mints per address. If a wallet address is not on the list, it will not be able to mint/purchase the listing.
The first line of the CSV should be the
ownerAddress,value
header.The contents should be
n
lines of 0xAllowListedAddress,0
... 0xAllowListedAddress,n-1
for every allow listed address, where n
is the number of tokens an address can mint.Make sure to include this
data-
prop in all widgets for a same listing on the same page.A URL to a CSV file used when the listing type is a fixed or variable price purchase. Limits who can mint, without limiting the amount an address can mint. If a wallet address is not on the list, it will not be able to mint/purchase the listing.
The first line of the CSV should be the
ownerAddress
header.Make sure to include this
data-
prop in all widgets for a same listing on the same page.Supported in CDN version: >= 2.4.0.
Useful for deferring the identity verification process to an external party. If this data attribute is
"true"
(string value of true
) on the HTML element and the listing in question has an identity verifier address, the element will emit a m-marketplace_tx_id_verify
event with the relevant transaction information to defer the identity verification process.This also means that the listing represented by this widget will defer the identity verification process and wait for a
m-marketplace_tx_id_complete
event with the appropriate data to resume the transaction.
Data attributes that change how a listing is displayed visually.
Used by Layout widgets to specify the backdrop for the token media. Is a JSON string of the following format:
interface MediaBackgroundConfig {
/** angle in degrees representing from which direction the gradient (linear/conic) flows */
angle?: number;
/** string array of colors for the media background */
colors?: string[];
/** URI to the background image. takes precedence over the background color/gradient */
image?: string;
/** if two or more color values are provided, specifies the type of background */
type?: 'linear' | 'conic' | 'radial';
}
It is suggested to provide a backup colour value in the case that the image does not load.
Example
- To display an image as a background for the token media:
<div
data-widget="m-layout-complete-listing"
data-id="LISTING_ID"
data-network="NETWORK"
data-media-background='{"image":"<image uri here>", "colors":["<backup color>"]}'
></div>
- To display a flat colour as the background for the token media:
<div
data-widget="m-layout-complete-listing"
data-id="LISTING_ID"
data-network="NETWORK"
data-media-background='{"colors":["<flat color>"]}'
></div>
- To display a gradient as a background for the token media:
<div
data-widget="m-layout-complete-listing"
data-id="LISTING_ID"
data-network="NETWORK"
data-media-background='{"colors":["<first color>","<second color>", "<third color>"],"type":"<gradient type>","angle":<numeric angle value if type is linear/conic>}'
></div>
This property is also available directly for
m-listing-image-expandable
. For versions < 3.0.0, see the widget for more details.
Data attributes to override text used in widgets.
Last modified 1mo ago