Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » 2nd editable area.

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

Page: 1
Go to End
Author Topic: 1750 Views
  • SightUnseen
    Avatar
    Community Member
    28 Posts

    2nd editable area. Link to this post

    We've chosen SilverStripe to move crew.org.nz to, and are looking forward to working with it.

    With the new template we're changing the layout, with the ad side panels from the forums going into the news section of the site (under SilverStripe) and going to have a right hand advertorial column inside this, with the main centre column only (dropping the left advertorial panel currently present.) The front page will be powered by the blog module, and where the space is for the widgets at present on the right we'd like to have a second area (along with the main panel) editable by the user. What is the best way to go about this?

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: 2nd editable area. Link to this post

    I'm not exactly sure what you mean? It sounds like the main content in the homepage is blog content and the right panel is static/editable? In which case under the main container iterate through the home pages' children (or any other parents' children), and have the right panel editable as $Content:

    <div id=main>
    <% control Children %>
    $Content <!-- display's the children's content -->
    <$ end_control %>
    </div>
    <div id="editorial">
    $Content <!-- home page's content -->
    </div>

    If you really need two different editable sections on the home page I believe you can add another CMS field as type HtmlEditorField. I haven't done this myself.

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Content2'), 'Content');    
    return $fields;
    }

    http://silverstripe.org/general-questions/show/269529?start=0#post269548
    http://doc.silverstripe.org/doku.php?id=htmleditorfield
    http://api.silverstripe.com/forms/fields-formattedinput/HtmlEditorField.html
    http://doc.silverstripe.org/doku.php?id=tutorial:2-extending-a-basic-site

  • SightUnseen
    Avatar
    Community Member
    28 Posts

    Re: 2nd editable area. Link to this post

    Thanks for the links - appreciated. Aspects of SilverStripe (like template creation, for example) appear almost too simple, when in fact it is how one does whatever it is in question. Still getting used to this.

    What we're aiming for is to have the blog holder for the front page, and have an advertorial column on the right hand of the front page only. We'll probably use the HigherGround template for the basis and modify it (we've created a test install here: http://crew.net.nz/dev/). The right hand side column is used for blog widgets by default, so I'm looking for the correct way putting in an editable field for the advertorial.

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: 2nd editable area. Link to this post

    I've only been using SS for 2 weeks myself

    Can you just replace the right hand blog widget code in the Blog Holder template with $Content? Or do you need more than that? I guess you need to define "advertorial" functionality.

  • SightUnseen
    Avatar
    Community Member
    28 Posts

    Re: 2nd editable area. Link to this post

    We've since confirmed the content and layout of the site with the client to a much better degree (which helps immensely).

    The ideal outcome is to keep the blog holder as it is, with the $Content serving the top of the blog holder (and home) page, so the client can put content there. Then, we'd like a second area to the right, where 'normal' content can be put, such as text, internal and external links, and images (see the right hand column on http://crew.org.nz for an idea of what we're after). However, we'd like this content to only show on the home page.

    Thanks in advance for any and all help

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: 2nd editable area. Link to this post

    Hey, then it sounds like you just need to create a 2nd content field like I mention in my first post. You can then add text, internal/external links, images etc. to $Content2 as you would $Content. The tutorial link explains how to go about adding extra fields to a page.

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