I’ve created a snippet for a contact sidebar.
- Created Documenttype with Template snippets/contact.php
- Created SnippetsController with action contactAction
- Created view/snippets/contact.php Template with code
- Added Snippet to page in the Backend “new Snippet” -> contact snippet -> name = “contact”
- Added snippet(“contact”); ?> to Template of Page
- Clicked on page editing and dropped the snippet in position
- Preview and editing only dispays “Hello world”
Why is my code in /snippets/contact.php not loaded?
It seems that it’s not enough to set “Template => snippets/contact.php”.
It still uses the default controller. You have to set “Controller” to “Snippet” and “Action” to “Contact” to get it working.