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.

Themes /

Discuss SilverStripe Themes.

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

How is the Order of Templates to be used


Go to End


3 Posts   1756 Views

Avatar
Andre

Community Member, 146 Posts

3 November 2015 at 10:07pm

The Following things I already evaluated:

Templates in Folder Framework get overwritten by Templates in the selected themes Folder get overwritten by Templates in Folder mysite (or any other folder I define as global $project).

But what about templates in other modules?

Avatar
helenclarko

Community Member, 166 Posts

4 November 2015 at 8:58am

Hi Andre,

The way I understand it is that any module/addon folders in your root directory (E.g. /htdocs) will override template (.ss) and PHP code files within your themes folder.

There are really only two places you want to have template (.ss) files, within either "themes/{themeName}/templates/Layout" OR the root folder (E.g. /htdocs) inside an addon/Module folder.

Your mysite folder is used for all your PHP coding, atleast when it comes to theming.
So your "mysite/code" folder will house all your PHP files, not template files (.ss) should be sitting in here.

Addons/modules have their own folder structure, most would simply start with a "code" folder and "template" folder.
The structure would look a little like below:

-Addon/Module Folder
	-code
		-PHP Files
	-templates
		-layouts
			-.SS Files
	-javascript
		-.js Files
	-css
		-css files
	_config.php (For configuration)
	composer.json (For composer setup)
	Readme.MD (For Github)

-helenclarko

Avatar
helenclarko

Community Member, 166 Posts

4 November 2015 at 8:59am

I guess that didnt really answer your question.

Modules/addons override everything else.

-helenclarko