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.

General Questions

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

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

Creating a site with content blocks


Go to End
Reply

13 Posts   4615 Views

Avatar
ianpiper

7 March 2009 at 12:27pm Community Member, 32 Posts

Hi all,

I'm a bit of a beginner with SilverStripe, I'm afraid, so bear with me if this is a dumb question.

I am designing a site in which there is just a main horizontal navigation menu and the content is arranged in a 3-column layout below. Each column may have one or more content blocks arranged vertically one above the other. These blocks contain a title, possibly an image, text and maybe other content.

I have designed a layout based on xhtml and css with divs to define the columns and blocks. What I can't quite grasp is how I translate this to Silverstripe so that I can create, say, 1 long block in column 1 and 2 blocks in columns 2 and 3.

There is a mock-up at this url that hopefully shows a rough idea of what I am trying to achieve (the actual content blocks are empty in this image at the moment):

http://www.tellura.co.uk/examples/3-column_layout.png

Does Silverstripe have the concept of a sub-page that I could define as having a title, image, content and so on?

Avatar
dab

7 March 2009 at 11:07pm Community Member, 50 Posts

Hello,
you should start from tutorials, especially second one, about adding news to the front page.
http://doc.silverstripe.com/doku.php
http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site#showing_the_latest_news_on_the_homepage

Avatar
ianpiper

8 March 2009 at 3:08am Community Member, 32 Posts

Thanks - yes, I had followed all of the tutorials. Apart from a few errors they are a good guide. However, here is where I am getting lost. Silverstripe has the concept (in the news tutorial) of an ArticleHolder which is effectively a container for one or more ArticlePages. So far so good. However, what I am trying to do is more complex: my content (maybe I should call it a ColumnsHolder) holds three columns, and each column holds one or more ContentBlocks. How does the naming convention work in this case? And how do you actually make these appear in the content creation window in the CMS editor?

Alternatively, should I simply ignore the columns as far as the editor is concerned (and manage them in the css) and simply have a page type of ContentBlockHolder which contains all of the ContentBlockPages - one for each content block that I want on the page? I suppose I could then have properties on each content block that identify its column and its row order.

It would just be useful to see a more complex example than the news page in the tutorial - can anyone point me at such an example?

Thanks,

Ian.
--

Avatar
dab

8 March 2009 at 6:48am (Last edited: 8 March 2009 6:51am), Community Member, 50 Posts

Hello! You may make new page type with new fields like Column1, Column2, Column3.
Or you may use DataObject::get_one for every PageType you need to show on front page.
Hope this will help you.

Avatar
chiefworker

31 July 2009 at 1:35pm Community Member, 6 Posts

Ian - did you ever find a solution to this? or did Dab's solution work?

Avatar
lawless

31 July 2009 at 2:07pm Community Member, 33 Posts

I'm guessing no -

"We have also taken this opportunity to completely redevelop the structure and content using Joomla, the premier open-source content management system."

from: http://www.tellura.co.uk

Avatar
Tim

31 July 2009 at 3:05pm Core Development Team, 201 Posts

Hi guys,

Just following up on this. Creating a three column layout is a trivial thing to do in SilverStripe - as is creating any layout for that matter. Dab's solution (of just having three content areas) is a very easy way to do this.

Avatar
ianpiper

31 July 2009 at 5:34pm Community Member, 32 Posts

Hi,

Sorry for the delay in replying. Yes, I have a nice solution that ends up being a bit of a mash-up of various solutions offered here together with my own hackery. I haven't changed my company site yet (hence the reference to Joomla). You can see the work in progress (yes, it's not finished yet) here:

http://skeyn.com/

The mechanism I've developed means that you can choose which column and row a particular article goes into, and also define the header bar colour and the thumbnail image if you want one.

I've almost got to the stage of putting in my content and then assuming it tests out OK I will be making it live.

If anyone is interested I'm happy to share the code (in fact you can probably help me to improve it!).

Regards,

Ian.
--

Go to Top