I will try to answer your main question and few that you asked in comments.
What is the purpose of this Page Content, and how can I use it?
Before that lets clarify what variants are
Variants:
Page Content is one of the simplest renderings in SXA (in terms of complexity).
Without variants it would be a rendering which displays a single field (same like basic rendering which displays page title).
Adding variants to a renderings change it in a way you can dynamically choose which fields should be used to display the content.
So instead of creating different components which are the same but displays different fields (content or title for example) you can have one with variants.
Yes. We could live without Title or Page Content rendering in SXA because both are working the same.
Page Content rendering
I think this is a key point here.
It displays fields which are present on your context item. Your current page is holding data for Page Content so there is no mapping needed.
Examples
Scenario 1: single field
I don't have any page designs. I want to put renderings directly on a page.
My page template has following specification: contains single field Content
.
Scenario 2: multiple fields
I don't have any page designs. I want to put renderings directly on a page.
My page template has following specification: contains fields Title
, Content
, Image
.
- I create a new item under home using my Page Template.
- Fill field Title with some text
- Fill field Content with some text
- Fill field Image with some image
- Open newly created Page and drop Page Content rendering
- Create new Rendering Variant, configure it to display
Title
, Content
, Image
fields and assign this to your Page Content (see screenshot below)
Now you will see that the rendering will display multiple fields from your page in a way you defined it in your Variant Definition. You can change the order of fields, change tags, add prefix, suffix, nest fields in some divs and so on.
Scenario 3: using page content on partial design
Like you already noticed when you use Page Content on partial design the only thing you see is Content field
(see example for multiple fields).
It is totally normal. We call it mock values for partial designs. You already know where the Page Content gets the fields from (from the context item).
When you are editing partial design you are currently on an item which does not contain any of your fields, so there is nothing to display.
If you use this partial design with page content on it on any page where fields are present you will see them rendered.
Different types of content in my "main" section.
Let's say you have footer
, header
partial designs.
You want to use footer
and header
on every page but have different center section (different main
) for different page types.
You have to define different partial designs and create different page designs then for different page templates.
Example:
News Page Design, which consists
header
partial design
main with news fields
partial design
footer
partial design
Blog Post Design, which consists
header
partial design
main with blog post fields
partial design
footer
partial design
Then you will have to map different designs to different page types:
From now each of your page will share the same parts like: footer
, header
but will have different main
depending on template.
Hope it helps