Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How do i do the tutorials?

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: 3099 Views
  • AdamSmith
    Avatar
    Community Member
    4 Posts

    How do i do the tutorials? Link to this post

    OK I install SilverStripe without any hitches.

    During the installation it gave me a choice of themes saying i could change later if i wanted to do the tutorials.

    So now i want to do the tutorials, how do i change the theme?

    Thanks
    Adam

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: How do i do the tutorials? Link to this post

    Hi adam, welcome to silverstripe

    themes are changed in the _config.php file which will be found in 'mysite'
    you will see a line which reads:

    SSViewer::set_theme('blackcandy');

    To change the theme you just swap 'blackcandy' with the theme name that you want to use, so you would change it to:

    SSViewer::set_theme('tutorial');

    you will also need to change the project as the tutorial uses the tutorial folder to store the code files. Look for the following line at the top of _config.php:

    $project = 'mysite';

    and change it to

    $project = 'tutorial';

  • AdamSmith
    Avatar
    Community Member
    4 Posts

    Re: How do i do the tutorials? Link to this post

    Hi Aram

    Thanks for that.

    I actually reinstalled the whole thing but chose the tutorial option at install time.

    I thought if i did the tutorials things would become clearer ...

    So i've now done the first two ( and very good they are too) but i'm non the wiser about switching themes yet....

    I couldn't understand your answer as after i reinstalled there was no config file inside the mysite folder, so it's just disappeared rather than changed.

    Someone mentioned this 4 months ago:

    Joe Golike 4
    "I'm a web developer myself, and pretty comfortable with PHP code. But after installing, I couldn't figure out how to switch to a different theme. You'd think that would be a pretty important feature that it would be obvious in the UI"

    So i guess this is still to be revealed...

    Adam

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: How do i do the tutorials? Link to this post

    Hi adam

    I think if you install for the tutorials then the _config.php file is in the 'tutorial' folder. Just follow the same instructions and change the appropriate line to your theme name and it should all be good

    If you have any more trouble don't hesitate to post, I'll try to be a bit more prompt with my answer next time! hehe

    p.s. if you are ready to start a proper site, I'd recomend installing with the blackcandy theme selected so that your config file is in the correct folder.

  • AdamSmith
    Avatar
    Community Member
    4 Posts

    Re: How do i do the tutorials? Link to this post

    OK I've done all the tutorials now so:

    Question 1:

    In tutorial 5 why did Projects need a special page of type ProjectHolder to put the Projects in
    while Mentor pages could be put directly into a regular page type?

    Question 2:

    I still don't inderstand the _config.php business. I've now finished the tutorials and am ready to start my own project. So how do i start that without reinstalling the whole thing? (I'm afraid i need it spelling out)

    Thanks
    Adam

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: How do i do the tutorials? Link to this post

    the ProjectHolder is used to manage the content, with out making it complex,

    see in the tutorial they have used a NewHolder, this is the same like that one,

    Have you work with any CMS system? all use some file to store the information which helps to run the CMS, like database host, db password and stuff.

    In SilverStripe the _config.php in the mysite folder stores those directives, which the CMS use to run.
    Also in the directory structure, when ever you have a folder, and a _config.php the CMS understand that it is as module, and runs the code. If it is not there it wont run the codes. And these _config.php files in the folders can store the configuration options which relevant to that specific module.

  • AdamSmith
    Avatar
    Community Member
    4 Posts

    Re: How do i do the tutorials? Link to this post

    My answer to Question 1:

    In the Mentor example there is actually no specific (to a
    mentor) content on the Mentor (holder) page (which is just a normal page) so you
    can just add normal content; whereas on the ProjectHolder page we put the table
    of all the projects (which needs is own template that can access Project
    properties), a normal page would just use the Page.ss template so a
    ProjectHolder class is created so that it will look for the ProjectHolder.ss template
    hence we can have customized content on the ProjectHolder page.

    Question 2:

    How do i start a new project?

    I moved the _config.php folder from the tutorials folder to the mysite folder and i

    changed
    $project = 'tutorial';
    to
    $project = 'mysite';

    But no good I get an HTTP 500 error

    So then i then i tried a dB flush
    - success!!

    But wait a minute, this is still the turorial site!!

    I clearly haven't grasped the concepts here.

    I though a new folder would = new web site, new objects different pages

    How can _config.php in the mysite folder still be using the objects from the tutorials folder???

    Is it one web site = 1 installation of SilverStripe , and different project folders (eg mysite, tutorials) are the same pages with different themes?

    Thanks
    Adam

    3099 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.