21304 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 733 Views |
-
mutliple textareas on each page

6 July 2010 at 3:24pm
Hi,
I am new to silverstripe,
just downloaded, went through a tutorial and setup my first silverstripe site, and I really like the simplicity of silverstripewhat I am wondering is:
How do I setup more than one editable textfield on a page? or is it possible? the tutorials (that I have seen) seem to only deal with one editable region.
my first layout/template has 3 columns and it would be great to have left nav and two editable separate textfields ,also, styling a css javascript dropdown menu to work with silverstripe, are there any good tutorials or faq on this?
thanks,
-
Re: mutliple textareas on each page

6 July 2010 at 6:16pm
Course you can have multiple textareas!. Each text area needs to be made a unique database fields and then a form field added to the CMS. In your case (sidebars) I think you would want to make them HTML Areas rather than plain text.
First step is add the fields to the database. Edit your $db array to something like this.. (tutorial 2 gives you an introduction to this)
static $db = array(
"LeftBoxTxt" => "HTMLText",
"RightBoxTxt" => "HTMLText"
);Second step is to add it the CMS (again this is covered in depth in tutorial 2)
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("LeftBoxTxt","Left box text"));
$fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('RightBoxTxt','Right box text'));
return $fields;
}After doing that rebuild your database (by visiting yoursite.com/dev/build) and now you should have 2 more editor fields in the cms which you can call in your template.
| 733 Views | ||
|
Page:
1
|
Go to Top |


