diff --git a/components/com_content/models/archive.php b/components/com_content/models/archive.php
index 5de3b822de9e7..25e22e97b20de 100644
--- a/components/com_content/models/archive.php
+++ b/components/com_content/models/archive.php
@@ -81,7 +81,10 @@ protected function populateState($ordering = null, $direction = null)
*/
protected function getListQuery()
{
- $params = $this->state->params;
+ $params = $this->state->params;
+ $app = JFactory::getApplication('site');
+ $catids = $app->input->getVar('catid', array());
+ $catids = array_values(array_diff($catids, array('')));
$articleOrderDate = $params->get('order_date');
// Create a new query object.
@@ -122,6 +125,11 @@ protected function getListQuery()
$query->where($query->year($queryDate) . ' = ' . $year);
}
+ if (count($catids)>0)
+ {
+ $query->where('c.id IN (' . implode(', ', $catids) . ')');
+ }
+
return $query;
}
diff --git a/components/com_content/views/archive/tmpl/default.xml b/components/com_content/views/archive/tmpl/default.xml
index a7be50a835d73..5f225fdaf11d3 100644
--- a/components/com_content/views/archive/tmpl/default.xml
+++ b/components/com_content/views/archive/tmpl/default.xml
@@ -9,6 +9,25 @@
+
+
+
+
+