Werner Krauss
Freelancer. Does PHP since 1998 and uses Silverstripe since 2009. Runs different customer websites and his main project, www.hallstatt.net with it.
When he's not in front of his laptop he enjoys family and playing his guitar.
Posts by Werner Krauss for Blog:
Setters done right
In case you're a fan of addding setters to your class or DataExtension avoid some simple pitfalls.
Read more about 'Setters done right'...
Read more about 'Setters done right'...
LogicException: getItemPath returned null for ClassName
When writing unit tests, sometimes you have a hard time to get them working. Today the error "LogicException: getItemPath returned null for ClassName" drove me crazy, but I found a solution.
Read more about 'LogicException: getItemPath returned null for ClassName'...
Read more about 'LogicException: getItemPath returned null for ClassName'...
How to move all Pages and DataObjects from Main Site to a Subsite
In case you want to move "Everything (tm)" from Main Site to a Subsite, there is no ready-to-use task available.
Read more about 'How to move all Pages and DataObjects from Main Site to a Subsite'...
Read more about 'How to move all Pages and DataObjects from Main Site to a Subsite'...
ModelAdmin: filter by $many_many with a dropdown
When you have a DataObject with a $many_many "Tags" => "Tag" you can add a filter dropdown in ModelAdmin by overwriting the scaffoldSearchFields() method:
Read more about 'ModelAdmin: filter by $many_many with a dropdown '...
Read more about 'ModelAdmin: filter by $many_many with a dropdown '...
Get all titles of a many_many component in a GridField summary
Assuming you have a DataObject with $many_many Tags, you can easily add all Tag's Titles comma seperated to $summary_fields using PHP's join method, even sorted by the SortOrder of the...
Read more about 'Get all titles of a many_many component in a GridField summary'...
Read more about 'Get all titles of a many_many component in a GridField summary'...
Show draft content to limited user group
Imagine your customer somehow needs to send draft pages (not published pages) to someone else for proof reading before he can publish it.
Read more about 'Show draft content to limited user group'...
Read more about 'Show draft content to limited user group'...
Subsites: Show modeladmin in backend on all subsites
By default subsites module disables all custom modeladmin classes in backend when you're not on the Main site (SubsiteID 0).
Read more about 'Subsites: Show modeladmin in backend on all subsites'...
Read more about 'Subsites: Show modeladmin in backend on all subsites'...
TITNFE: Template in theme not found error
Sometimes your template in your theme is not found. Why?
Read more about 'TITNFE: Template in theme not found error'...
Read more about 'TITNFE: Template in theme not found error'...
Subsites: hide "Main Site" from subsite chooser in backend
So your client wants to manage multiple websites with one CMS installation and you've choosen Subsites module for that purpose, there is always that magical "Main Site" in your site chooser.
Read more about 'Subsites: hide "Main Site" from subsite chooser in backend'...
Read more about 'Subsites: hide "Main Site" from subsite chooser in backend'...
Simple spam protection for comments
Running a blog or other type of comment form without spam protection is a bit risky theese days. But sometimes you want others to comment on your writings.
Read more about 'Simple spam protection for comments'...
Read more about 'Simple spam protection for comments'...