How to Create a Silverstripe Template

104 32
    • 1). Open the folder labeled "themes/tutorial/templates.ss" from the files saved on the web server that hosts your site.

    • 2). Copy the file "Page.ss" and save the new file under the name for your new template, being sure to include ".ss" as the end of the name so that your server will recognize the file type. The name of this file will have to match a page created on the site. For instance, if you are making a template for the home page you should called the template "HomePage.ss."

    • 3). Open the copied file. This should display a very basic default HTML template that begins with the string "<html><head><% base_tag %>", ends with the string "</html><%-- comment --%>" and includes several basic strings for content in between.

    • 4). Edit this file for the unique content you want to use in this template. Use an html code book if you are unfamiliar with html to help you use the correct tags for the content you want displayed.

    • 5). Save your file to keep the changes you have made. This file will still be available under the "themes/tutorial/templates.ss" folder.

    • 6). Flush the cache to make the template appear on the page of the same name as the template on the front-end of the website.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.