Jump to:

1149 Posts in 2553 Topics by 408 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Best way to upgrade silverstripe and keep customisations?

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2129 Views
  • jorrie
    Avatar
    Community Member
    40 Posts

    Best way to upgrade silverstripe and keep customisations? Link to this post

    What would be the best way to upgrade silverstripe?

    And on a sidenode, whats the best way to keep customisations away from the core?
    I feel php applications always are a pain to update
    ruby on rails app is more simple with git

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Best way to upgrade silverstripe and keep customisations? Link to this post

    You'll find with SS that you should be able to customize most of the functionality by using decorators and subclasses which are keep in your mysite folder and themes which need to be overridden can be from your own templates folder. This applies to css and templates for core, modules. Directly editing the core sapphire or cms folders as you say can be a very bad idea and hard to maintain.

    If you're hacking the core to fix a bug, then if its a valid bug make a ticket / patch for it to be included in core. I mean every apps going to be a pain to update if you hack around with the core. If you used to git you can always try out git-svn to 'manage' svn like git. I find like git but managing svn externals are a bit of a pain.

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Best way to upgrade silverstripe and keep customisations? Link to this post

    As Will said, I will NEVER edit the files in:

    /sapphire
    /cms
    /jsparty

    It is so easy to extend sapphire's core classes that there is very little need to do so. If you simply subclass the original core class, all the original functionality is there for you to tinker with without touching the main classes.

    The advantage of Git you speak of with RoR is exactly the same on Silverstripe using Subversion. I use it to update core all the time.

  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: Best way to upgrade silverstripe and keep customisations? Link to this post

    What about when customizing the css or .ss files for a module?
    Is there an easy way to preserve these and keep php code upto date with SVN?

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: Best way to upgrade silverstripe and keep customisations? Link to this post

    The convention here is to create a module sub-theme of you theme which looks like: themes/mytheme_module take a look at blackcandy_blog as an example.
    You can add templates and css to your hearts content knowing that your changes will not get overwritten by a module update, although you may need to update them to include any API changes.

    If you want to change php code for a module then you're best off decorating it instead of editing module code.

    hth

  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: Best way to upgrade silverstripe and keep customisations? Link to this post

    Thanks for your reply TotalNet.

    I'm glad to hear that themes/mytheme_module will overwrite default templates.

    However, Im having trouble extending an existing module. Can you see this thread?

    2129 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.