Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Having difficulty understanding how to extend Silverstripe code?


Go to End


2 Posts   647 Views

Avatar
simples

Community Member, 77 Posts

15 August 2012 at 11:59pm

Edited: 16/08/2012 3:56am

This comment is based on my personal findings so may differ from your experiences.

Information in the Silverstripe documentation, other than in the tutorials, in view of what a cms covers, has to be very concise. As such it is usually insufficient for the purpose of equiping a developer, who is new to Silverstripe, to actually write code to extend functionality. If the information is not in a tutorial, the page in the Silverstripe topics is sometimes extremely brief. This can leave the reader wondering what is involved and what needs to be done in terms of implementation. For me I found the following was helpful.

  • (a) Changing and chopping code in the tutorials and then seeing what happened helped me to see the significance of different code.

  • (b) Books - there are currently 2 books - the complete guide based on Version 2.3 and the module extension/themes book based on 2.4. I found the latter book more suited to my way of learning and is of course more up to date.

  • (c) The internet for forum comments and tutorials Googling often locates useful articles in the Silverstripe forums. Locating a particular forum comment this way obviously depends on the comment existing in the Google index. However I found the search facility in the forum itself to be quite lacking and, without the ability to search on phrases, throws up much material which is not relevant. Perhaps I am not using the facility correctly.

  • (d) Comments in PHP class files added to the Sapphire and cms folders.

I am new to Silverstripe and have been learning Silverstripe on and off for the past 3 weeks. I first of all concentrated on the Silverstripe documentation and the tutorials in particular. I think tutorials 1 and 2 give a good grounding. I have yet to really get into the remaining tutorials. However I find I can only read so much before things stop sinking in. In order to augment the learning process, I then started to create a real site for a client where I had to work to a specification. As expected I found things which were not in the core code and was unable to locate exactly what I wanted in existing modules. I then supplemented reading the Silverstripe documentation with material found by googling and reading the books.

Today I discovered I could improve my understanding of how to extend code by spending more time reading comments in the PHP classes (see (d) above). Of course, browsing code and reading comments is a patently obvious way of learning how code works. However as a programmer who has so far avoided writing and extended classes and often finds following such code difficult, I have spent very little time browsing the code base during the time I have been looking at Silverstripe. Nevertheless I think my progress in getting things done would have been quicker if I had put more effort into doing this before today.

Avatar
DesignerX.com.au

Community Member, 107 Posts

19 August 2012 at 12:52am

Hi:
I noticed you have started my threads asking question which could have been answered by finishing the tutorials .
Please finish the tutorials , even if we try to explain to you ; you will not understand what we talking about . Things like how to create a new page type, how to create new template files , the file structure of modules, how to modify or extend code are all explained in the tutorials you just need to read them ;)
Not trying to be rude here but unless you know the basics about SS our answers will be just copy-past from the tutorials & they still may mean nothing to you :(

The books are still for SS2.4 but the tutorials are updates for SS3 , so I recommend using the tutorials & working with the latest SS release (SS 3.0.1 )
Finish the tutorials & if you get stuck or need few thing clarified , I will be more then happy to help :)