mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Added editable Title field to TagCloudWidget
This commit is contained in:
parent
60e4f4c3b2
commit
6a3225df22
@ -18,7 +18,9 @@ class BlogEntry extends Page {
|
|||||||
static $db = array(
|
static $db = array(
|
||||||
"Date" => "Datetime",
|
"Date" => "Datetime",
|
||||||
"Author" => "Text",
|
"Author" => "Text",
|
||||||
"Tags" => "Text"
|
"Tags" => "Text",
|
||||||
|
"ShowOnHomepage" => "Boolean",
|
||||||
|
"RedirectionURL" => "Varchar(255)",
|
||||||
);
|
);
|
||||||
|
|
||||||
static $casting = array(
|
static $casting = array(
|
||||||
@ -26,7 +28,8 @@ class BlogEntry extends Page {
|
|||||||
);
|
);
|
||||||
|
|
||||||
static $defaults = array(
|
static $defaults = array(
|
||||||
"ProvideComments" => true
|
"ProvideComments" => true,
|
||||||
|
"ShowOnHomepage" => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
static $allowed_children = "none";
|
static $allowed_children = "none";
|
||||||
@ -77,6 +80,8 @@ class BlogEntry extends Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fields->addFieldToTab("Root.Content.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content");
|
$fields->addFieldToTab("Root.Content.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content");
|
||||||
|
$fields->addFieldToTab("Root.Content.Main", new CheckboxField("ShowOnHomepage", _t("BlogEntry.SHOWONHOMEPAGE", "Show on homepage?")),"Content");
|
||||||
|
$fields->addFieldToTab("Root.Content.Main", new TextField("RedirectionURL", _t("BlogEntry.REDIRECTIONURL", "Redirect straight to this URL")),"Content");
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,6 +166,10 @@ class BlogEntry extends Page {
|
|||||||
class BlogEntry_Controller extends Page_Controller {
|
class BlogEntry_Controller extends Page_Controller {
|
||||||
function init() {
|
function init() {
|
||||||
parent::init();
|
parent::init();
|
||||||
|
if($this->RedirectionURL) {
|
||||||
|
Director::redirect($this->RedirectionURL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Requirements::themedCSS("blog");
|
Requirements::themedCSS("blog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user