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.

Customising the CMS /

2nd editable area.


Reply


6 Posts   1757 Views

Avatar
SightUnseen

Community Member, 28 Posts

25 September 2009 at 7:04pm

We've chosen SilverStripe to move [url]crew.org.nz[/url] 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?

Avatar
Dave L

Community Member, 56 Posts

25 September 2009 at 7:36pm

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

Avatar
SightUnseen

Community Member, 28 Posts

26 September 2009 at 3:11pm

Edited: 26/09/2009 3:13pm

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.

Avatar
Dave L

Community Member, 56 Posts

27 September 2009 at 1:26pm

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.

Avatar
SightUnseen

Community Member, 28 Posts

28 September 2009 at 6:40pm

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 :-)

Avatar
Dave L

Community Member, 56 Posts

28 September 2009 at 6:49pm

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.