RSS Feed

Silverstripe remove CustomScript


Silverstripe Tip of the week:

Sometimes you have to remove a customScript of a module, because you want to script it differently.

If the module author was so wise to give his customScript a ID (UserFormsValidation in this case) like they did in UserForms:

    (function($) {...})(jQuery);
, 'UserFormsValidation');

then you can do the following in the init function of your subclass controller:


Easy, isnt it?

no comments yet

Silverstripe RedirectorPage open external Link in new window


Silverstripe Tip of the Week:

If you want to open a “Other website URL” Link of a RedirectorPage in a new window with target=_blank, you can use the following snippet:

<% if ExternalURL %>
   <a href="$ExternalURL" class="external" target="_blank">$MenuTitle.XML</a>
<% else %>
   <a href="$Link">$MenuTitle.XML</a>
<% end_if %>

Or this one:

<% if is_a(RedirectorPage) %><% if RedirectionType = External %>target="_blank"<% end_if %><% end_if %>

found here:

Hope it Helps!

no comments yet

[Symfony 2][Assetic] Sass, CompassFilter + Foundation Responsive Front-end Framework


Did you ever wonder how to enable 3rd party plugins (or so called “frameworks“) within the great compass toolset managed by assetic in your edgy symfony 2.1 project?

(If there is more extensive documentation available concerning assetic + CompassFilter, please stop reading on and let me know!)

If you take a look at the filter class itself (it is CompassFilter in the generic Assetic\Filter namespace), you should recognise several option values that you can use in your application wide config.yml file.

But first you have to install the framework plugin following these instructions.

» read more


Create Google XML (Image) Sitemaps in PHP


Ever wanted to create a Google XML Image Sitemap?

This is how it could be done with PHP: » read more

no comments yet

Symfony2 from YAML to XML configuration


Actually i was a fan of YAML regarding the configuration files of Symfony2.
This was probably because i was used to it since symfony 1.4 and i also thought its better readable.
Its partly still true, but my Netbeans Editor has some problems with using @ in YAML and this breaks my highlighting.
So the better readability vanished to nirvana.

So i checked out XML configuration. Its also widely used by the community.
Pros and Cons (mostly Pros) you can read in this post by Fabien.

» read more


Check if a country is an EU country in Magento


I you ever wondered how you can check if a Country, resp. a Country Code, is in the EU, i did the following:

Magento has a config value: eu_countries that lists all Countries of the EU.

You can find it in the backend under:
Configuration -> General -> Country Options.

Against this list you can validate your country code, f.e. that you got in an billing or shipping address of an order.

» read more


Caching Data in Symfony2


Symfony2 has a great Caching Layer based on its HTTP Cache. But this aims mainly on caching the views.

In some apps however you need to cache data behind the scenes, f.e. responses from API calls or custom objects sets.
Symfony2 itself doesnt have such a functionality on first sight (symfony2 doesnt, but Doctrine, see below) and so I searched for one and first found a bundle which utilize the Zend Cache lib:

This worked well but as discussed here( this adds dependencies to your Symfony2 project. This is actually not necessary since Doctrine/Commons is almost always part of your Symfony2 distribution and the Doctrine/Commons provides a Cache Layer as well.
A very good one, indeed.

So if you need to cache data use Doctrine/Commons.
» read more


Opengraph MetaTags in SilverStripe


First off some general thoughts on how to use opengraph metatags.
Since the uprise of Social Media, sharing sites, deeplinking and snippetting content has become a important aspect of SEO and so almost every site has some kind of facebook-like-button to let user easily share the page.
Most sharing endpoints, facebook f.e, bring a more or less good parser/linter to summarize the page content. So the first text paragraph will be taken as text snippet and all images that fit certain requirements will be offered to chose a preview-thumbnail from.
So far so good.
» read more


Symfony2 Starter Tweaks


When you start with symfony you probably use the Symfony Standard Edition.
This is a quite good start but there are somethings that helped me and might help you aswell.
Since every beginning is “schwer” :)
So here there are.
» read more


Silverstripe Profilable module


This is a reoccuring requirement: you need a profile for some object in your project.
FE you have a company, a member or a location that should get an address, a marker on the map, an icon, homepage etc.

So I created a small silverstripe module that adds a profile tab to any object you choose in your Silverstripe CMS backend.

» read more

no comments yet