Jump to:

1382 Posts in 491 Topics by 521 members


SilverStripe Forums » Themes » Themes and Code

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 776 Views
  • Apophis
    Community Member
    4 Posts

    Themes and Code Link to this post

    From the documentation:

    A theme does not include any PHP: instead it should be separate from the code which allows the portability of a design. After all, this is an MVC framework!"

    Currently I am developing an advanced theme for myself it's currently already pretty feature complete in comparison to most of the featured themes, however to ever think about posting it, I have a big Problem, and I'd like to know how you address it.

    A theme gives the views and the presentation of functionality, but you only theme for certain functionaility, of course all the Base functionality, and some Themes even have templates for certain modules, but obviously thats it. After that you are on your own.

    Example: My Theme has a HomePage class with a News Sliders on it, a Twitter feed and so on - this needs a backend, some code.

    Currently it resides in the mycode directory, but it is hillarious, the twitter feed makes only sense with my Theme and If I would make the theme available somone would need to have the code too. Otherwise it is pretty useless. Of course I could make a module out of it, never done that before. But even then the Theme cannot say: I need Module x, otherwise I am pretty broken.

    There needs to be some kind of control from the Theme to the code, at least in a declarative Manner. If you only do it for yourself or your projects this is only a small thing of course. But the documentation says this inconvienience is because of portability. I disagree without any control it makes the code less portable, a view is worthless without a controller, and to develop more advanced themes you need some information on what is available to display. Or the CMS itself needs more base functionality.

    I'd like to hear opinions or solutions, and especially if there are any plans to help the developer in any way with this Problem.

  • Willr
    Forum Moderator
    5497 Posts

    Re: Themes and Code Link to this post

    This is my biggest issue with themes, themes in fact are pretty useless in SS. If you want to bundle code with your theme (say for sliders) then you either have to have the PHP code in a separate module for users to install, or tell users in the README to copy the classes from X to mysite/code.

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.