Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Couple of questions

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1044 Views
  • eKstreme
    2 Posts

    Couple of questions Link to this post


    I just heard of SS at Read/Write Web. Looks very very good. I have two questions that I couldn't answer from searching the docs.

    Basically, I want to create a web app with a login system built in and a blog and forum and other features to interact with the community.

    1. Can PHP code be part of the page's content? This would be useful for doing database lookups.

    2. If so, is there a way to figure out if a user is logged in or not?


  • Matt
    Core Development Team
    84 Posts

    Re: Couple of questions Link to this post

    We try to separate design/layout and code as much as possible, so you can't just put PHP directly into your page templates, but you can achieve the same thing by adding something to both your template and code files, for example inside your Page.php and Page.ss files:

    /** Get something cool
    * @return CoolObject Something that's cool
    function GetCoolThing() {
    return $this->cool;

    And in your template, just use the following:

    <!-- To access a field on whatever you return (e.g. The time a page was created) -->

    Hope that helps some - if you want to know anything else, take a look at the tutorials, they should help you get started.

  • eKstreme
    2 Posts

    Re: Couple of questions Link to this post

    Thanks for that Matt. I'll dig into the tutorials.


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.