Struggling with this one. Any help is greatly appreciated.
I have a large/long blueprint for various product types (apologies). I’m trying to use a field conditional “when” a toggles value for item_type is met…
- The toggles field is not showing up unless I remove the fields with conditionals / and or remove conditionals
- Is there a limit on the number of conditionals one can use for fields? Again I have a lot. as shown below.
- Am I just making a stupid mistake I don’t see?
- Maybe there’s a better way to do this?
Blueprint: item.yml
* Just a note, I am using the Table Field plugin by Bogdan Condorachi
title: Item
tabs:
product:
label: Product Info
columns:
- width: 2/3
sections:
items:
type: fields
fields:
product_title:
label: Title
type: text
buttons: false
size: large
width: 1/2
price:
label: Retail Price
type: number
placeholder: 00.00
step: .01
before: $
width: 1/4
after: Before Tax
wholesale_price:
label: Wholesale Price
type: number
placeholder: 00.00
step: .01
before: $
width: 1/4
after: Before Tax
line_2:
type: line
width: 1/1
item_type:
label: Product Type
type: toggles
options:
- value: book
text: "Book"
- value: music
text: "Music"
- value: apparel
text: "Apparel"
- value: accessory
text: "Accessory"
- value: art
text: "Art"
- value: product
text: "Product"
width: 1/1
sold_out:
label: Sold Out?
type: toggle
text:
- "no"
- "yes"
width: 1/3
in_stock:
label: In Stock?
type: toggle
text:
- "no"
- "yes"
width: 1/4
new_release:
label: Item New?
type: toggle
text:
- "No"
- "Yes"
width: 1/4
preorder_release:
label: Preorder Release?
type: toggle
text:
- "No"
- "Yes"
width: 1/4
headline_1:
type: headline
label: Product Details
width: 1/1
line_3:
type: line
width: 1/1
author:
label: Author
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Book"
book_description:
label: Book Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Book"
book_type:
label: Release Type
type: checkboxes
columns: 2
options:
- "Hardcover"
- "Softcover"
- "Zine"
- "Periodical"
width: 1/3
when:
item_type: "Book"
page_count:
label: Page Count
type: number
width: 1/3
when:
item_type: "Book"
book_dimensions:
label: Dimensions (inches)
type: text
placeholder: "L x W x H"
width: 1/3
when:
item_type: "Book"
book_publisher:
label: Publisher
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Book"
isbn:
label: ISBN ISSN
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Book"
book_catalog_number:
label: Catalog Number
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Book"
music_artist:
label: Composer/Artist
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Music"
artist_website:
label: Artist Website
type: table
columns:
- label: Name
type: text
- label: URL
type: url
width: 1/1
when:
item_type: "Music"
music_description:
label: Music Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Music"
music_format:
label: Format
type: checkboxes
columns: 2
options:
- "Vinyl"
- "CD"
- "Cassette"
width: 2/3
when:
item_type: "Music"
music_duration:
label: Duration (minutes)
placeholder: "00:00"
type: text
width: 1/3
when:
item_type: "Music"
music_catalog_number:
label: Catalog Number
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Music"
music_label:
label: Record Label
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Music"
music_publisher:
label: Publisher
type: table
columns:
- label: Name
type: text
- label: URL
type: url
width: 1/1
when:
item_type: "Music"
apparel_description:
label: Apparel Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Apparel"
apparel_type:
label: Apparel Type
type: checkboxes
columns: 2
options:
- "T-Shirt"
- "Hoodie"
- "Crew"
- "Jacket"
- "Other"
width: 1/1
when:
item_type: "Apparel"
apparel_materials:
label: Materials
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Apparel"
apparel_color:
label: Color
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Apparel"
apparel_sizes:
label: Available Sizes
type: checkboxes
columns: 2
options:
- "XS"
- "S"
- "M"
- "L"
- "XL"
- "XXL"
width: 1/3
when:
item_type: "Apparel"
accessory_type:
label: Accessory Type
type: toggles
options:
- "Tote Bag"
- "Hat"
- "Pin"
- "Patch"
- "Sticker"
- "Other"
width: 1/1
when:
item_type: "Accessory"
accessory_description:
label: Accessory Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Accessory"
art_artist:
label: Artist
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Art"
art_title:
label: Title of Artwork
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Art"
art_description:
label: Art Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Art"
art_website:
label: Artist Website
type: table
columns:
- label: Name
type: text
- label: URL
type: url
width: 1/1
when:
item_type: "Art"
art_year:
label: Year Created
type: number
width: 1/3
when:
item_type: "Art"
art_medium:
label: Medium
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Art"
art_dimensions:
label: Dimensions (inches)
type: text
placeholder: "L x W x H"
width: 1/3
when:
item_type: "Art"
item_type:
label: Product Type
type: text
buttons: false
size: medium
width: 1/1
when:
item_type: "Product"
product_description:
label: Product Description
type: textarea
buttons: false
size: small
width: 2/3
when:
item_type: "Product"
product_brand:
label: Brand
type: text
buttons: false
size: medium
width: 2/3
when:
item_type: "Product"
product_model:
label: Model Number
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Product"
product_sku:
label: SKU
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Product"
product_color:
label: Color
type: text
buttons: false
size: medium
width: 1/3
when:
item_type: "Product"
product_dimensions:
label: Dimensions (inches)
type: text
placeholder: "L x W x H"
width: 1/3
when:
item_type: "Product"
product_weight:
label: Weight (lbs)
type: number
step: .01
width: 1/3
when:
item_type: "Product"
- width: 1/3
sticky: true
sections:
sidebar:
type: fields
fields:
cover:
extends: fields/cover
label: Hero Image
listing_date:
label: Listing Date
type: date
width: 1/2
releasae_date:
label: Release Date
type: date
width: 1/2
tags:
label: Product Category
type: tags
width: 1/1
stockist:
label: Stockists
type: table
columns:
- label: Name
type: text
- label: URL
type: url
- label: Country
type: text
- label: State/Province
type: text
- label: City
type: text
width: 1/1
shipping:
type: checkboxes
columns: 2
options:
- USPS Priority Mail
- USPS Priority Mail Express
- USPS 2nd Day Air
- Digital Delivery
width: 1/1
images:
label: Product Images
columns:
- width: 1/1
sticky: true
sections:
procuct_images:
type: fields
fields:
gallery:
label: Product Images
type: files
template: image
info: "{{file.alt}}<br>{{ file.dimensions }}"
layout: cards
size: small
image:
cover: true
ratio: 1/1
back: white
Cheers. Emmit.
