Skip to main content

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>
SSR AvailableThis component is available for server side rendering.

Properties

PropertyAttributeDescriptionTypeDefault
affiliateaffiliatestringundefined
affiliateTypeaffiliate-typestringundefined
contextcontextstringundefined
ctaTypecta-typestringundefined
deferdeferbooleanundefined
devModedev-modebooleanfalse
deviceTypedevice-type"android" | "desktop" | "ios" | "mobile"undefined
fieldfield"affiliate-name" | "affiliate-terms" | "affiliate_name" | "affiliate_terms" | "bonus" | "cta" | "term" | "terms" | "title"undefined
gameIdgame-idnumberundefined
initialValueinitial-valuestring''
internalIdinternal-idstringundefined
isBetsyncUseris-betsync-userbooleanundefined
isMobileis-mobilebooleanundefined
leagueleaguestringundefined
linklinkbooleanfalse
locationlocationstringundefined
moduleTitlemodule-titlestringundefined
pageSlugpage-slugstringundefined
placementIdplacement-idnumberundefined
propertyIdproperty-idnumberundefined
subdivisionsubdivisionnumberundefined
subscriptionTiersubscription-tier0 | 1 | 2 | 3undefined
underlineunderlinebooleanfalse
wasProwas-probooleanundefined

Shadow Parts

PartDescription
"link"