Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

8521 Posts in 2218 Topics by 1198 members

General Questions

SilverStripe Forums » General Questions » Can Silverstripe handle multiple content regions on a page?

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

Page: 1
Go to End
Author Topic: Can Silverstripe handle multiple content regions on a page? 589 Views
  • rdr
    avatar
    Community Member
    7 posts

    Can Silverstripe handle multiple content regions on a page? Link to this post

    I'm currently evaluating SilverStripe and have been unable to find an answer to this -- maybe because I can't think of a succinct way to phrase it. I have two requirements:

    1. Suppose I have a content page which has a wide area for the main page content, and then, to its side, a narrow column where I'd like content editors to be able to create page-specific content (related links, call-to-action graphics, etc).

    2. Similar scenario to the above, but suppose I want my narrow column to be a generic global block that content editors can edit. In other content management systems (e.g. CMS Made Simple) these are referred to as Global Content Blocks. I understand the SS concept of includes, but can these be edited inside the software?

    Really grateful if anyone can point me in the right direction. I've worked through the Level 1 and Level 2 tutorials and like what I see; really hoping I can use SS for some client projects.

  • aram
    avatar
    Community Member
    485 posts

    Re: Can Silverstripe handle multiple content regions on a page? Link to this post

    Hi rdr, welcome to the Silverstripe forums!

    You can do both of those things. If you want a second page specific content area you can add another HTMLEditorField to the Page class in Page.php

    If you want a generic sidebar which is editable in the CMS, you can do what I described in this thread: http://www.silverstripe.org/customising-the-cms/show/252007

    Hope that helps, if you have any more questions just ask

  • UncleCheese
    avatar
    Forum Moderator
    2660 posts

    Re: Can Silverstripe handle multiple content regions on a page? Link to this post

    Well, this is the great thing about Silverstripe. When they say "template freedom" this is what they're referring to. Other CMS's try to usher you into their pre-cooked opinions of how a page should look and the nomenclature that they use to define it, e.g. "global content blocks." There's no such thing in SS. You do with your template what you want, because every page type and the components that make it up are a reflection of a database structure.

    So to answer your question, there are a million ways to do it. If you just want generic content, here's the easiest way:

    code/Page.php

    static $db = array (
    'SideContent' => 'HTMLText'
    )
    function getCMSFields()
    {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab("Root.Content.Sidebar", new HTMLEditorField('SideContent','Sidebar content'));
    return $fields;
    }

    and of course on your template

    <div class="sidebar">$SideContent</div>

    If you want to get into something more rich like adding custom objects (like a "link" object with a title, URL, description, for instance) or syndicating content from elsewhere on the site, that's also very easy, but this should get you started.

  • rdr
    avatar
    Community Member
    7 posts

    Re: Can Silverstripe handle multiple content regions on a page? Link to this post

    Aram and UncleCheese, cheers fellas; plenty there for me to start playing around with.

  • rdr
    avatar
    Community Member
    7 posts

    Re: Can Silverstripe handle multiple content regions on a page? Link to this post

    Thanks again guys, I've got this working a treat.

    Looking at the SS documentation, I can't see a user entry point for what I think are very common needs for extending page templates (static content blocks, multiple editable regions on a page). There's almost the assumption that you're a PHP programmer and will get the "big picture" of the programming model. I wonder how true that reality is for a good amount of people who are tasked with implementing a CMS and building sites?

    I'm a designer who can hack scripts and configure a Linux webserver pretty well, but I'm not a PHP programmer and have no desire to be one. I think it would be great if some clever people extended articles in the wiki to include some more prefab PHP code for what are every day needs for most websites. The tutorial covering a news page (for example), is great.

  • UncleCheese
    avatar
    Forum Moderator
    2660 posts

    Re: Can Silverstripe handle multiple content regions on a page? Link to this post

    I agree. The news module tutorial is definitely the best place to start. I work with a designer, who also has an allergy to PHP code, and when he's in a jam, he just duplicates the code from that tutorial.

    But you do make a good point. This is definitely a programmer's CMS. There's no way around it. My hope is that someday SS takes the ExpressionEngine3 model and makes a UI for building data models and CMS interfaces, rather than just leaving it to "obscure" PHP code.

    589 Views
Page: 1
Go to Top

Currently Online: BigChris, Euphemismus

Welcome to our latest member: GreenWork

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.