mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
fixed the show by tag
This commit is contained in:
parent
b1e4d27b42
commit
55e1174884
@ -109,7 +109,7 @@ class BlogHolder extends Page {
|
||||
/**
|
||||
* Only display the blog entries that have the specified tag
|
||||
*/
|
||||
function Tag() {
|
||||
function ShowTag() {
|
||||
if(Director::urlParam('Action') == 'tag') {
|
||||
return Director::urlParam('ID');
|
||||
}
|
||||
@ -269,6 +269,15 @@ class BlogHolder_Controller extends Page_Controller {
|
||||
|
||||
return $output;
|
||||
}
|
||||
function tag() {
|
||||
if($this->ShowTag()) {
|
||||
return array(
|
||||
'Tag' => $this->ShowTag()
|
||||
);
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rss feed for this blog holder's entries
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
class TagCloudWidget extends Widget {
|
||||
static $db = array(
|
||||
"Title" => "Varchar",
|
||||
"Limit" => "Int",
|
||||
"Sortby" => "Varchar"
|
||||
);
|
||||
"Title" => "Varchar",
|
||||
"Limit" => "Int",
|
||||
"Sortby" => "Varchar"
|
||||
);
|
||||
|
||||
static $defaults = array(
|
||||
"Title" => "Tag Cloud",
|
||||
@ -111,7 +111,6 @@ class TagCloudWidget extends Widget {
|
||||
"Class" => $class,
|
||||
"Link" => $blogHolder->Link() . 'tag/' . urlencode($tag)
|
||||
);
|
||||
Debug::show($allTags[$tag]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -139,18 +138,16 @@ function column_sort_by_popularity($a, $b){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function natksort(&$aToBeSorted)
|
||||
{
|
||||
function natksort(&$aToBeSorted) {
|
||||
$aResult = array();
|
||||
$aKeys = array_keys($aToBeSorted);
|
||||
natcasesort($aKeys);
|
||||
foreach ($aKeys as $sKey)
|
||||
{
|
||||
foreach ($aKeys as $sKey) {
|
||||
$aResult[$sKey] = $aToBeSorted[$sKey];
|
||||
}
|
||||
}
|
||||
$aToBeSorted = $aResult;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user