2

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?

1

Global templates are absolutely possible by taking advantage of the Twig {% extends %} tag. You can read more about template inheritance in Twig's documentation.

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 (or use a plugin), you can set editing privileges just to admins. Simply create a header and footer partial template and include them in a main template file that your other templates extend.

| improve this answer | |
  • 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 Apr 28 '15 at 16:41
  • 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 Apr 28 '15 at 16:48
  • 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 if you wanted to take a look. – Aaron Berkowitz Apr 28 '15 at 16:53
  • Great, thank you for the advice and the GitHub resource you provided Aaron! – Simon O Apr 29 '15 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.