Hi Jackson,
Welcome to the Silverstripe forums. I myself am new and have only been using SS for 3 weeks at my new job. For your problem this is how I would tackle it. Maybe a SS veteran would have a better way i dont know.
In the Code folder create a new php file and call it LinksHolder.php
LinksHolder.php should have the following code:
class LinksHolder extends Page {
//Path to icon for the cms if you want a custom one, otherwise comment it out
static $icon = "";
static $db = array(
);
static $has_one = array(
);
static $has_many = array(
);
// This makes sure that only links can be children
static $allowed_children = array(
'LinkItem'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeFieldFromTab("Root.Content.Main","Content");
return $fields;
}
}
Then create a new file called LinkItem.php in the code folder
Here is the code to include in linkitem.php:
class LinksItem extends Page {
//Self explanatory, Its parent can only be LinksHolder and it cant be a root item.
static $default_parent = 'LinksHolder';
static $can_be_root = false;
static $db = array(
"LinkTitle" => "Text",
"LinkURL" => "Varchar"
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new TextField("LinkTitle", 'Link Title'),"Content");
$fields->addFieldToTab("Root.Content.Main", new TextField("LinkURL", 'URL Address'),"Content");
return $fields;
}
}
class LinksItem_Controller extends Page_Controller {
}
At this point I would run a dev/build/?flush=1
//To be continued, be right back