<p>Global templates are absolutely possible by taking advantage of the Twig <a href="http://twig.sensiolabs.org/doc/tags/extends.html" rel="nofollow"><code>{% extends %}</code></a> tag. You can read more about <a href="http://twig.sensiolabs.org/doc/templates.html#template-inheritance" rel="nofollow">template inheritance in Twig's documentation</a>.</p>

<p>If you set up multiple sections, you can assign certain users edit privileges to their appropriate sections.</p>

<p>You can set up your navs and footers as <a href="http://buildwithcraft.com/docs/globals" rel="nofollow">Globals</a> (or use a <a href="http://straightupcraft.com/craft-plugins" rel="nofollow">plugin</a>), you can set editing privileges just to admins. Simply create a header and footer partial template and <a href="http://twig.sensiolabs.org/doc/tags/include.html" rel="nofollow">include</a> them in a main template file that your other templates extend. </p>

CC BY-SA 3.0
2015-04-28T16:41:34.630Z
Thanks for the advice Aaron. For the global header and footer, would there be a way to supply a js or php snippet code to none. Also, great job on the CraftCMS summit.
Simon O
CC BY-SA 3.0
2015-04-28T16:48:21.323Z
Sorry i didnt have time to finish this comment...For the global header and footer, do you have a recommendation for supplying a js or php code snippet for sites outside of this solution (static or different backends) to display the header and footer dynamically?
Simon O
CC BY-SA 3.0
2015-04-28T16:53:43.883Z
Thanks, Simon! You could actually use the API methods I discussed at the Summit to serve an outside site any content from your Craft installation. You could create an API call to return either the data from your globals, or even a rendered HTML string to append to a div. I put [some of the code up on GitHub](https://github.com/aberkie/craft-summit-api) if you wanted to take a look.
Aaron Berkowitz
CC BY-SA 3.0
2015-04-29T12:44:16.220Z
Great, thank you for the advice and the GitHub resource you provided Aaron!
Simon O
CC BY-SA 3.0
2015-04-28T15:34:46.383Z
2015-04-28T15:34:46.383Z
Aaron Berkowitz
<p>Our university is made up of many small sites.  I'd like to use craft for this.  Love the auto update feature.  I want each site to share template styles (ie. staff directories, document listings, etc.) but I want to be able to update this global library of templates as time goes on so all sites have access to the latest options.  Also being able to make a change to a global navigation and footer and have all sites updated at the same time would be key.</p>

<p>Does anyone have any suggestions on how to achieve this?</p>

<multi-environment><multi-site>
Multiple sites sharing global templates
# Multiple sites sharing global templates

(Asked by: username_0 on 2015-04-28)

Our university is made up of many small sites. I'd like to use craft for this. Love the auto update feature. I want each site to share template styles (ie. staff directories, document listings, etc.) but I want to be able to update this global library of templates as time goes on so all sites have access to the latest options. Also being able to make a change to a global navigation and footer and have all sites updated at the same time would be key.

Does anyone have any suggestions on how to achieve this?

**Tags:** multi-environment, multi-site


---

## 1 answers

### Answer by username_1 on 2015-04-28. Score: 1 | Accepted answer

Global templates are absolutely possible by taking advantage of the Twig [`{% extends %}`](http://twig.sensiolabs.org/doc/tags/extends.html) tag. You can read more about [template inheritance in Twig's documentation](http://twig.sensiolabs.org/doc/templates.html#template-inheritance).

If you set up multiple sections, you can assign certain users edit privileges to their appropriate sections.

You can set up your navs and footers as [Globals](http://buildwithcraft.com/docs/globals) (or use a [plugin](http://straightupcraft.com/craft-plugins)), you can set editing privileges just to admins. Simply create a header and footer partial template and [include](http://twig.sensiolabs.org/doc/tags/include.html) them in a main template file that your other templates extend.

> **Comments:**
> **username_0**: Thanks for the advice Aaron. For the global header and footer, would there be a way to supply a js or php snippet code to none. Also, great job on the CraftCMS summit.  
> **username_0**: Sorry i didnt have time to finish this comment...For the global header and footer, do you have a recommendation for supplying a js or php code snippet for sites outside of this solution (static or different backends) to display the header and footer dynamically?  
> **username_1**: Thanks, Simon! You could actually use the API methods I discussed at the Summit to serve an outside site any content from your Craft installation. You could create an API call to return either the data from your globals, or even a rendered HTML string to append to a div. I put [some of the code up on GitHub](https://github.com/aberkie/craft-summit-api) if you wanted to take a look.  
> **username_0**: Great, thank you for the advice and the GitHub resource you provided Aaron!  

---

