Jump to:

22997 Posts in 11620 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Creating a site with content blocks

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

Page: 1 2
Go to End
Author Topic: 4345 Views
  • ianpiper
    Avatar
    Community Member
    32 Posts

    Creating a site with content blocks Link to this post

    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?

  • dab
    Avatar
    Community Member
    50 Posts

    Re: Creating a site with content blocks Link to this post

    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

  • ianpiper
    Avatar
    Community Member
    32 Posts

    Re: Creating a site with content blocks Link to this post

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

  • dab
    Avatar
    Community Member
    50 Posts

    Re: Creating a site with content blocks Link to this post

    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.

  • chiefworker
    Avatar
    Community Member
    6 Posts

    Re: Creating a site with content blocks Link to this post

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

  • lawless
    Avatar
    Community Member
    33 Posts

    Re: Creating a site with content blocks Link to this post

    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

  • Tim
    Avatar
    Core Development Team
    201 Posts

    Re: Creating a site with content blocks Link to this post

    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.

  • ianpiper
    Avatar
    Community Member
    32 Posts

    Re: Creating a site with content blocks Link to this post

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

    4345 Views
Page: 1 2
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.