Home - Your one stop SilverStripe learning resource
- Show all
- CMS
- Security
- DataObjects
- Site Tree
- Images
- CSS
- Templates
- Forms
- Member
- Decorators
- SiteConfig
- WYSIWYG
- Errors
- Database
- JavaScript
- Comments
- Themes
- SilverStripe
- SSBits
- URLs
- Translations
- Languages
- Login
- Site of the Month
- Relations
- DataObjectManger
- Screencast
- Installing
- cPanel
- Model Admin
- Controllers
- interview
- SilverStripe 3
- Review
- Search
- Reports
-
SnippetsCreating a Page Export Function
6 May 2009 | | | Supports v2.4, v2.3
TweetNeed to create an 'export' function for a page? Do it quickly and cleanly with HTTP::sendFileToBrowser. In your page controller, add a new action 'export':
Continue reading... -
NewbiesCreating a Simple Contact Form
3 May 2009 | | | Supports v2.4, v2.3
Tweet
In this tutorial we are going to create a very simple contact form, like those commonly seen on most contact-us pages. This is a great introduction to SilverStripe forms for those new to the Subject and should also provide enough functionality for most people to use straight out of the box.
Continue reading... -
SnippetsCreate a CMS Field in 'Page' but not it's Descendants
26 April 2009 | |
TweetSometimes you may want a field to appear in pages of type Page but not in the other PageTypes which extend Page. To limit a field added via the function getCMSFields() is a simple case of adding an if() statement to test the current pages class.
Continue reading... -
SnippetsCreate and use a Permission code
18 April 2009 | | | Supports v2.4, v2.3
TweetHave you wanted to add an extra permission code that you can add to groups and then use that to test whether a particular user has that permission? Here's how it's done. The permission code it self is added via the Controller class, then you use a permission check anywhere in your site code to check the current user. Like so:
Continue reading... -
SnippetsGetting objects from multiple child pages
14 April 2009 | | | Supports v2.4, v2.3
TweetWhen you want to create a DataObjectSet encompasing objects from all the current pages children you can do something like this
$pageIDs = $this->getDescendantIDList(); $ObjectSet = DataObject::get( "Object", "`ObjectPageID` IN (" . implode(",", $pageIDs) . ")" );Continue reading... -
Blog10 Super Useful SilverStripe Documentation Pages
11 April 2009 | |
TweetSince I started learning SilverStripe I have come across a number of very useful documentation pages which were not very easy to find (at least not as easy as they could be). So here is a list of 10 official documentation pages which I always find myself referring back to.
Continue reading... -
TutorialsCustom Login Form with Group Based Redirection
7 April 2009 | | | Supports v2.4, v2.3
TweetIn this tutorial we are going to create a system that allows the Admin to decide which (front-end) page a group of users are redirected to after login. This will be defined via a TreeDropdown for each group in the security section, and can also be set to send them to the admin area via a checkbox.
Continue reading... -
SnippetsCheck to see if a widget area has any widgets
5 April 2009 | |
TweetIf you want to check that a WidgetArea actually has widgets, and only display it if it has, you can add this function to your Page_Controller (where widgetBarID is the name of your widgetArea + ID)
function HasWidgets() { return DataObject::get("Widget", "ParentID = $this->WidgetbarID"); }Continue reading... -
NewbiesBuilding a SilverStripe Theme from a Static Template
26 March 2009 | | | Supports v2.4, v2.3
Tweet
In this tutorial we are going to create a SilverStripe theme from a static template. While completing this tutorial, you will build a good foundation for using the SilverStripe templating language and be able to create themes with dynamic menus and content areas.
Continue reading... -
SnippetsGet errors e-mailed to you
24 March 2009 | | | Supports v2.4
TweetIf your site is live it means you are probably not getting errors reported in the view, so it's handy to have them emailed to you so you can still debug and also be notified if something is up.
Add this line to your mysite/_config.php file and expect some mail!
SS_Log::add_writer(new SS_LogEmailWriter('me@mydomain.com'), SS_Log::ERR);
Continue reading... -
SnippetsResizing and Manipulating Images
22 March 2009 | | | Supports v2.4, v2.3
TweetYou can resize images from within the template very easily. But sometimes you need to resize it and just use the URL value, something you can't do by calling the resize on the variable directly (e.g. $Image.CroppedImage(200,200)). This is how we would create a cropped resize of it and still be able to use just the URL, allowing a custom <img> tag.
Continue reading... -
BlogAn Example CSS Framework
24 March 2008 | | | Supports v2.4, v2.3
Tweet
A CSS framework is a set of pre-prepared style sheets that can be used as a starting point for any project. Using a framework allows you to skip all the tedious parts of getting the basics right and lets you start working on what makes your site different from the beginning.
Continue reading...