21298 Posts in 5735 Topics by 2603 members
| Go to End | Next > | |
| Author | Topic: | 3889 Views |
-
Creating a site with content blocks

7 March 2009 at 12:27pm
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?
-
Re: Creating a site with content blocks

7 March 2009 at 11:07pm
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 -
Re: Creating a site with content blocks

8 March 2009 at 3:08am
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.
-- -
Re: Creating a site with content blocks

8 March 2009 at 6:48am Last edited: 8 March 2009 6:51am
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. -
Re: Creating a site with content blocks

31 July 2009 at 1:35pm
Ian - did you ever find a solution to this? or did Dab's solution work?
-
Re: Creating a site with content blocks

31 July 2009 at 2:07pm
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
-
Re: Creating a site with content blocks

31 July 2009 at 3:05pm
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.
-
Re: Creating a site with content blocks

31 July 2009 at 5:34pm
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:
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.
--
| 3889 Views | ||
| Go to Top | Next > |




