Field
Show a text value from a promotion inline with other HTML
Overview
The purpose of this component allows you to drop CTA text, bonus code, affiliate names, etc. into the copy on an HTML page and have it pull from the placement based on the provided props.
When used with pre-rendering, in the case where the client geolocated promo can’t be found, the original value that hydrated during the rendering will be preserved.
If the <bam-field> components used on the page all call the same placement-id, only a single API call will be made on the backend and when the script loads the placement based on the user’s location, all the <bam-field> components will get the update at the same time.
<bam-field
location="FL"
placement-id="1172"
property-id="1"
context="new-york-post-right-rail"
internal-id="subscription"
affiliate-type="sportsbook"
field="cta"></bam-field>
You can control specific styling of the link text using the ::part pseudo-class like:
<style>
.button-test bam-field::part(link) {
color: black;
text-decoration: none;
font-size: 2rem;
}
</style>
<span style="font-weight: 700" class="button-test">
<bam-field
id="field1"
dev-mode="true"
placement-id="265"
property-id="1"
location="FL"
field="title"
context="new-york-post-right-rail"
link="true"
underline="true"
>
</bam-field>
</span>
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
affiliate | affiliate | string | undefined | |
affiliateType | affiliate-type | string | undefined | |
context | context | string | undefined | |
ctaType | cta-type | string | undefined | |
defer | defer | boolean | undefined | |
devMode | dev-mode | boolean | false | |
deviceType | device-type | "android" | "desktop" | "ios" | "mobile" | undefined | |
field | field | "affiliate-name" | "affiliate-terms" | "affiliate_name" | "affiliate_terms" | "bonus" | "cta" | "term" | "terms" | "title" | undefined | |
gameId | game-id | number | undefined | |
initialValue | initial-value | string | '' | |
internalId | internal-id | string | undefined | |
isBetsyncUser | is-betsync-user | boolean | undefined | |
isMobile | is-mobile | boolean | undefined | |
league | league | string | undefined | |
link | link | boolean | false | |
location | location | string | undefined | |
moduleTitle | module-title | string | undefined | |
pageSlug | page-slug | string | undefined | |
placementId | placement-id | number | undefined | |
propertyId | property-id | number | undefined | |
subdivision | subdivision | number | undefined | |
subscriptionTier | subscription-tier | 0 | 1 | 2 | 3 | undefined | |
underline | underline | boolean | false | |
wasPro | was-pro | boolean | undefined |
Shadow Parts
| Part | Description |
|---|---|
"link" |