SlideShare a Scribd company logo
Howto Create a
Page Elements Template
Prequesites

   A working setup of         General
    Silverstripe CMS            understanding of
   A copy of the page-            HTML
    elements module                CSS
    extracted in the root          Web Design
First Steps
   Open the “blackcandy/” folder in “themes/”
   Look in Page.ss:
    “$Layout” is where the template will be inserted.
   Doesn't work for you?
      Create a copy “Gridpage.ss” and modify it.
   Have a look at the documentation Silverstripe
    provides about the powerfull template engine:
    http://doc.silverstripe.org/doku.php?id=templates
Creating the template file

   Create a new file called “GridPage_test.ss” in
    “themes/demo/Layout/”
   This file will be inserted in Page.ss in $Layout
   Create the html layout in your favorite Editor.
Building the Layout

   Put “$Slot()” as placeholders in the dynamic
    areas.
   Think about a useful name for these areas:
       “MainContent”, “LeftSidebar”, “Tagline” etc
   Put these names inside the bracket:
    “$Slot(Name)”
    Eg. $Slot(MainContent)
Example file

<div class=”Content”>
  <div class=”Top”>
           $Slot(Top)
  </div>
  <div class=”Columns”>
           <div class=”ColumnRight”>
                    $Slot(Right)
           </div>
           <div class=”ColumnLeft”>
                    $Slot(Left)
           </div>
  </div>
Some Notes

   Slotnames should be short and useful.
   They must be unique across the file (not the
    theme though)
   It makes sense using the same name for
    simmilar areas on different templates.
Using it

   Run http://yoursite/dev/build/?flush=1
   Login to the Admin interface in Silverstripe
   Select the page you wish to edit
   In the behavior tab ensure that the pagetype is
    set to “GridPage”
   Select your template in the Dropdown menu.
   Save!
   You should see the layout editor in the Content
    Tab
The end

   Start adding elements in the Slots and putting
    your site together.
   Enjoy!
   Questions, Comments, Ideas?
       Please check
        http://www.page-elements.com/

More Related Content

KEY
Let's Build a Custom Theme
PPSX
Session 2 intro to Css
PPT
SEO: A Web Design Perspective
PPSX
Session Two css
PPTX
Blade Template and Laravel
PPTX
Sitecore KT for Layout
PPT
Css class-01
PDF
Mozilla Brick - Frontend Rhein-Main June 2014
Let's Build a Custom Theme
Session 2 intro to Css
SEO: A Web Design Perspective
Session Two css
Blade Template and Laravel
Sitecore KT for Layout
Css class-01
Mozilla Brick - Frontend Rhein-Main June 2014

Similar to Building a Silverstripe Page Elements template for Web designers (20)

PDF
Drupal theming
PPT
PPTX
Front end performance optimization
PPT
Easy Guide to WordPress Theme Integration
PDF
Pfnp slides
PPTX
Themes
PPT
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
PDF
Z04 etano template_basics
PPTX
DOCX
Master page
DOC
Intermediate Web Design.doc
DOC
Intermediate Web Design.doc
PPTX
The War on ActionView with Russian Doll Caching
PPT
Css Founder.com | Cssfounder se
PPTX
WordPress HTML, CSS & Child Themes
PPTX
Writing your own WordPress themes and plugins
PDF
Future-proof styling in Drupal (8)
PPTX
Developing Branding Solutions for 2013
PPTX
Developing and Deploying Custom Branding Solutions in SharePoint 2010
PDF
Design Systems, Pattern Libraries & WordPress
Drupal theming
Front end performance optimization
Easy Guide to WordPress Theme Integration
Pfnp slides
Themes
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
Z04 etano template_basics
Master page
Intermediate Web Design.doc
Intermediate Web Design.doc
The War on ActionView with Russian Doll Caching
Css Founder.com | Cssfounder se
WordPress HTML, CSS & Child Themes
Writing your own WordPress themes and plugins
Future-proof styling in Drupal (8)
Developing Branding Solutions for 2013
Developing and Deploying Custom Branding Solutions in SharePoint 2010
Design Systems, Pattern Libraries & WordPress
Ad

Recently uploaded (20)

PPTX
Business Ethics - An introduction and its overview.pptx
PPT
Data mining for business intelligence ch04 sharda
PDF
How to Get Funding for Your Trucking Business
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PDF
Types of control:Qualitative vs Quantitative
PDF
COST SHEET- Tender and Quotation unit 2.pdf
DOCX
Euro SEO Services 1st 3 General Updates.docx
PPTX
Lecture (1)-Introduction.pptx business communication
PDF
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
DOCX
Business Management - unit 1 and 2
PPT
Chapter four Project-Preparation material
PDF
IFRS Notes in your pocket for study all the time
PDF
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
PPTX
Probability Distribution, binomial distribution, poisson distribution
PPTX
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Business Ethics - An introduction and its overview.pptx
Data mining for business intelligence ch04 sharda
How to Get Funding for Your Trucking Business
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
Roadmap Map-digital Banking feature MB,IB,AB
Types of control:Qualitative vs Quantitative
COST SHEET- Tender and Quotation unit 2.pdf
Euro SEO Services 1st 3 General Updates.docx
Lecture (1)-Introduction.pptx business communication
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
DOC-20250806-WA0002._20250806_112011_0000.pdf
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
Business Management - unit 1 and 2
Chapter four Project-Preparation material
IFRS Notes in your pocket for study all the time
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
Probability Distribution, binomial distribution, poisson distribution
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Ad

Building a Silverstripe Page Elements template for Web designers

  • 1. Howto Create a Page Elements Template
  • 2. Prequesites  A working setup of  General Silverstripe CMS understanding of  A copy of the page-  HTML elements module  CSS extracted in the root  Web Design
  • 3. First Steps  Open the “blackcandy/” folder in “themes/”  Look in Page.ss: “$Layout” is where the template will be inserted.  Doesn't work for you? Create a copy “Gridpage.ss” and modify it.  Have a look at the documentation Silverstripe provides about the powerfull template engine: http://doc.silverstripe.org/doku.php?id=templates
  • 4. Creating the template file  Create a new file called “GridPage_test.ss” in “themes/demo/Layout/”  This file will be inserted in Page.ss in $Layout  Create the html layout in your favorite Editor.
  • 5. Building the Layout  Put “$Slot()” as placeholders in the dynamic areas.  Think about a useful name for these areas:  “MainContent”, “LeftSidebar”, “Tagline” etc  Put these names inside the bracket: “$Slot(Name)” Eg. $Slot(MainContent)
  • 6. Example file <div class=”Content”> <div class=”Top”> $Slot(Top) </div> <div class=”Columns”> <div class=”ColumnRight”> $Slot(Right) </div> <div class=”ColumnLeft”> $Slot(Left) </div> </div>
  • 7. Some Notes  Slotnames should be short and useful.  They must be unique across the file (not the theme though)  It makes sense using the same name for simmilar areas on different templates.
  • 8. Using it  Run http://yoursite/dev/build/?flush=1  Login to the Admin interface in Silverstripe  Select the page you wish to edit  In the behavior tab ensure that the pagetype is set to “GridPage”  Select your template in the Dropdown menu.  Save!  You should see the layout editor in the Content Tab
  • 9. The end  Start adding elements in the Slots and putting your site together.  Enjoy!  Questions, Comments, Ideas?  Please check http://www.page-elements.com/