Layout options for content types in CWS D7
Someone: Hey! We need to post all of our recipes on our website!
You: Great! I'll make a content type with tons of fields!
Someone: Sure, whatever that means. Just make sure it looks nice.
You: Um, (gulp) Yeah sure, no problem...
<aside>
View modes
</aside>
We marking up templates.
Better than marking up content since we aren't adding layout in our content.
More discussion at:
Paragraphs module?
First off, congratulate yourself for not just dumping a ton of content in a body field.
and
Drag and drop reorder of fields, nesting possible with field groups (accordions too), move fields to "Hidden"
Hide/show label, above or inline (take care for mobile)
Format - depends on field type, important for images/files
Gear icon - where the magic happens once expert field templates are enabled in DS
View modes*
*Provides different displays in different situations, e.g. teaser, RSS, full content.
Can be used in Views (oh yeah! more on this later)
The "Full content" view mode will now show up. Click that tab.
Visit bottom of page and choose a layout to activate DS goodies
Now we're ready!
and
Title
Description
photo
Directions
ingred-
ents
Pretty close
Needs work!!!
Format of ingredients field (on recipe content type manage display) to "fields only" this gets rid of the edit links when viewing the node
Now let's work in the field collection's manage display
Need to get these all on the same line. But how?
Display suite custom field
Views (possible, but only as a backup)
Again, add a custom display option for "full content" and save
Visit the Full content view mode and pick one column for the layout, save, and the other DS options will appear as vertical tabs
1
2
Custom fields FTW!
Go to admin/structure/ds/fields and add a "Code field" there.
Name it and choose "field collection item"
In the Limit field add field_recipe_ingredients|*
So this will only show on the one field collection
In the code field at the bottom, check the Token box and add the fields you want to combine. Similar to rewriting a views output in Views
In a single line, I added these tokens:
[field_collection_item:field-ingredient-quantity] [field_collection_item:field-ingredient-uom] [field_collection_item:field-ingredient]
On the manage display page for the "Full content" view mode for the field collection, your new custom field shows up under disabled.
Move it to enabled and move the rest to disabled.

Party time!
We go back to the Recipe content type
Change the field template to "Expert"*
Change the label to "Ingredients"
Make the element "h3"
Check the Hide label colon box
Update and Save
Let's improve the hierarchy of our HTML and...
*Enable field templates at /admin/structure/ds/list/extras


expands!
oh the options!


Spacing?
Now an H3!
Enable and configure the text formats for CSS and full CSS
Add your CSS
Use web inspector to find the class we want to use

I choose .field-collection-item-field-recipe-ingredients



Add a new view mode at admin/structure/ds/view_modes
Look Ma! No fields!
Limited fields on node
Full data in view