Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Develop my first template


Go to End


6 Posts   1673 Views

Avatar
Kai

Community Member, 4 Posts

1 February 2011 at 8:55am

Hello, I am a Joomla superuser & developer, and I have used Joomla for over 5 years now. I am also a PHP developer, and I have developed a bunch of Joomla templates. I work as a webdeveloper at a ad-agency, and I would like to start using SilverStripe for new sites. SilverStripe looks very promising, and really look forward to get to know more about this tool.

Since I am new to SilverStripe, I would like to know how to build my own template? I would like to create a new template from scratch. I have coded my own HTML template with CSS. What is correct folderstructure?

I tried to duplicate the tutorial template, but that didn't worked well.

Avatar
Mrfixer

Community Member, 49 Posts

1 February 2011 at 11:39am

My advise would be to check the tutorial again, i followed it myself only 2 days ago and im having no problems at all, important points would be to note that:

"mysite" folder contains your _config.php and also a sub-folder "code" that contains the controllers for your page templates (important if you need to add seperate fields into a page templates CMS)

as for the folder structure of your theme just place your themes folder into the "themes" folder alongside blackcandy and tutorial themes, then its just a case of ensuring that inside your theme folder you have a "css, images and templates" folders and inside the templates folder"Layouts and Includes" includes folder for includes such as footer and in my case left/right sidebars and header and then Page.ss inside templates file and also in the Layouts folder (any other page templates that you have created as .php inside "mysite/code" folder also need to be in here with the same name as in "mysite/code" except with a .ss extension)

Dont forget to edit mysite/_config.php with your theme name and dont do what i kept doing and not adding the $Form variable into your theme, lost count of the number of times i did this and had to edit config back to blackcandy so i could login to CMS.

Like i say im new to SS too but these are my settings and working great at this end, if they aint 100% im sure someone will correct me

Avatar
Willr

Forum Moderator, 5523 Posts

1 February 2011 at 1:20pm

For more theme / template documentation check out the Wiki - http://doc.silverstripe.org/sapphire/en/topics/theme-development.

Avatar
Kai

Community Member, 4 Posts

1 February 2011 at 7:54pm

Thanks for your reply Mrfixer, I reuploaded the template and it worked fine with flush. I forgot to edit the config files, but thanks to you for pointing that out for me. SilverStripe looks very promising, and I really look forward to start using this amazing tool.

I hope the GUI in CMS will be modernized a bit for next versions - looks a bit old to me

Avatar
deny

Community Member, 1 Post

10 February 2011 at 9:37pm

Thanks for reply,Because its first develop my first template.

Avatar
Willr

Forum Moderator, 5523 Posts

12 February 2011 at 12:37am

I hope the GUI in CMS will be modernized a bit for next versions - looks a bit old to me

Yes this is one of the major discussion points in the dev mailing list (http://groups.google.com/group/silverstripe-dev). The design has been around since the first 2.0 release (2006/7) with some minor enhancements in 2.2 done.