mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
Added editable Title field to TagCloudWidget
This commit is contained in:
parent
e3eeffafc9
commit
9289d6ed04
@ -2,16 +2,17 @@
|
|||||||
|
|
||||||
class TagCloudWidget extends Widget {
|
class TagCloudWidget extends Widget {
|
||||||
static $db = array(
|
static $db = array(
|
||||||
|
"Title" => "Varchar",
|
||||||
"Limit" => "Int",
|
"Limit" => "Int",
|
||||||
"Sortby" => "Varchar"
|
"Sortby" => "Varchar"
|
||||||
);
|
);
|
||||||
|
|
||||||
static $defaults = array(
|
static $defaults = array(
|
||||||
|
"Title" => "Tag Cloud",
|
||||||
"Limit" => "0",
|
"Limit" => "0",
|
||||||
"Sortby" => "alphabet"
|
"Sortby" => "alphabet"
|
||||||
);
|
);
|
||||||
|
|
||||||
static $title = "Tag Cloud";
|
|
||||||
static $cmsTitle = "Tag Cloud";
|
static $cmsTitle = "Tag Cloud";
|
||||||
static $description = "Shows a tag cloud of tags on your blog.";
|
static $description = "Shows a tag cloud of tags on your blog.";
|
||||||
|
|
||||||
@ -30,11 +31,16 @@ class TagCloudWidget extends Widget {
|
|||||||
|
|
||||||
function getCMSFields() {
|
function getCMSFields() {
|
||||||
return new FieldSet(
|
return new FieldSet(
|
||||||
|
new TextField("Title", _t("TagCloudWidget.TILE", "Title")),
|
||||||
new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")),
|
new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")),
|
||||||
new OptionsetField("Sortby",_t("TagCloudWidget.SORTBY","Sort by"),array("alphabet"=>_t("TagCloudWidget.SBAL", "alphabet"),"frequency"=>_t("TagCloudWidget.SBFREQ", "frequency")))
|
new OptionsetField("Sortby",_t("TagCloudWidget.SORTBY","Sort by"),array("alphabet"=>_t("TagCloudWidget.SBAL", "alphabet"),"frequency"=>_t("TagCloudWidget.SBFREQ", "frequency")))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Title() {
|
||||||
|
return $this->Title ? $this->Title : 'Tag Cloud';
|
||||||
|
}
|
||||||
|
|
||||||
function Tags() {
|
function Tags() {
|
||||||
Requirements::css("blog/css/tagcloud.css");
|
Requirements::css("blog/css/tagcloud.css");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user