Sitecore / Sitecore.Pathfinder

Get started, get far, get happy!
Other
34 stars 12 forks source link

Allow defining layout on template #65

Closed adeneys closed 7 years ago

adeneys commented 7 years ago

Best practice for a website build dictates that presentation should be defined on template standard values, and not on each item directly.

I propose allowing presentation to be defined in a template in the same way we use Layout in an item definition:

- Template: MyTemplate
    BaseTemplates: /sitecore/templates/sample/Sample Item
    Layout:
        - Default: MyLayout
            - MainPH:
                - Content

Upon build, the layout will be set on the standard values item for the tempate.

JakobChristensen commented 7 years ago

You can now specify a __Standard Values item as part of the template. This follows the standard format for items.

- Folder: Tests
    ItemPath: /sitecore/client/Applications/SitecoreWorks/content/TemplateStandardValuesTest
    Database: master
    - Items: 
        - Template:
            Name: TemplateStandardValuesTest
            - Section: Fields
                - Field: IsActive
                    Type: Checkbox
                    Sharing: Shared
                - Field: Text
                    Type: Single-Line Text
                    Sharing: Unversioned
            - TemplateStandardValuesTest: __Standard Values
                - Fields:
                    IsActive: true
                    - en:
                        Text: Welcome to Sitecore
                - Layout:
                    - Default: Sample Layout
                        - main:
                            - Sample Sublayout:
                                - centercolumn:
                                    - Sample Inner Sublayout:
                                        - content:
                                            - Sample Rendering: