This is the launchpad for how-to recipes using the SS2/Sapphire engine. Users of the community are encouraged to add their own functions and how-tos here as well! Just login and hit the edit this page button on the bottom right.
We are currently trying to develop a cheat sheet, please login / create an account and add your suggestions for this cheat sheet on the linked page.
ajax basics how to create
AJAX-based applications in Silverstripe
-
pretty i18n urls - put your language code in the url, not as GET parament behind like ?lang=
populatedefaults - Add a dynamic default value to a field using PopulateDefaults()
-
-
grouping fields from your data object - this can be useful if you would like to create a control in your template that loops through a bunch of fields (that may be labelled $image1, $image2, $image3) from your dataobject
-
example of quotes on a page - this example will cover how to add a 'Quotes' section to a page and you will be able to create / delete quotes via the
CMS.
Final Parent - want to find out what is a page its ultimate parent then use this code
-
selecting pages with the same grandparent imagine you have continents, countries and region with several shops in each region and you want to find out what shop are in the same country - then this is useful
alternative sorting order if you want to sort your pages in a different order than the standard SiteTree order then this might be useful
customising_image - customising the Image class for specific generation of uploaded images
-
-
-
Amazing Looking Forms - shows how to create cool looking forms using the powerful silverstripe form rendering engine
-
-
siblings - similar to <% control Children %> but then for siblings
-
-
-
-
-
-
-
-
-
-
SimpleSearch - just a search box, which refers to a results page
-