Is it possible to pull out only one specific part, and -then- have a separate loop that grabs all the other parts?
Put another way, I’d like to exclude one part from the above code so it spits out all the parts except one, and I want to display the other part by itself somewhere else. Not sure if that makes sense. Anyone know if it’s possible?
Sure, you can do that, for example using first(), last() or nth() you can get them by their position in the collection. Or you can filter them by some sort of criteria, depends on your use case.
Let’s assume you wanted to get the first element and then there rest:
Actually I think I have a better question -> Is it possible to use a “Parts” section in a blueprint for a page (so I can add sub-content to it) and have normal fields on the page too?
That would give me the same result, and potentially in an easier way…
sections:
fields:
projectCategories:
label: What categories did this project fall into?
type: structure
max: 3
fields:
category:
label: Category (e.g. Strategy, Design or Development)
type: text
projectSummary:
type: text
label: The Perfect Summary
parts:
headline: Parts
type: pages
empty: Add at least a project intro you noob.
status: all
info: "{{ project.intendedTemplate }}"
image: false
templates:
- project-intro
- project-summary
- project-screenshot
- project-text-row
- project-image-and-text
- project-left-image-and-text
- project-quote
title: My blueprint
sections:
myFieldsSection:
type: fields
fields:
# your fields here
myParts:
type: pages
# section for your subpages that make up the sections
You can, of course, use columns or tabs to create a nice layout for this stuff.
I tried to click the Heart icon 1,000,000,000 times but my browser crashed and my mouse caught fire.
I’m still wrapping my brain around the blueprint formatting - every time I’m introduced to something reserved like “parts” where the nesting is different, it throws me. Thank you so much for your patience.