diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 5c56dff94..04ba737fa 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -31,6 +31,7 @@ use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\ContentQuery; use Thelia\Model\FolderQuery; use Thelia\Type\TypeCollection; use Thelia\Type; @@ -55,6 +56,7 @@ class Folder extends BaseI18nLoop return new ArgumentCollection( Argument::createIntListTypeArgument('id'), Argument::createIntTypeArgument('parent'), + Argument::createIntTypeArgument('content'), Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('not_empty', 0), Argument::createBooleanOrBothTypeArgument('visible', 1), @@ -107,6 +109,16 @@ class Folder extends BaseI18nLoop $search->filterById($exclude, Criteria::NOT_IN); } + $content = $this->getContent(); + + if (null !== $content) { + $obj = ContentQuery::create()->findPk($content); + + if($obj) { + $search->filterByContent($obj, Criteria::IN); + } + } + $visible = $this->getVisible(); if ($visible != BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0); diff --git a/templates/admin/default/content-edit.html b/templates/admin/default/content-edit.html index 9be698560..994cbd994 100644 --- a/templates/admin/default/content-edit.html +++ b/templates/admin/default/content-edit.html @@ -42,7 +42,7 @@