diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index e40e95815..bbf9e2c78 100755 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -66,6 +66,7 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface Argument::createBooleanTypeArgument('current_folder'), Argument::createIntTypeArgument('depth', 1), Argument::createBooleanOrBothTypeArgument('visible', 1), + Argument::createAnyTypeArgument('title'), new Argument( 'order', new TypeCollection( @@ -148,6 +149,11 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0); + $title = $this->getTitle(); + + if (!is_null($title)) { + $search->where("CASE WHEN NOT ISNULL(`requested_locale_i18n`.ID) THEN `requested_locale_i18n`.`TITLE` ELSE `default_locale_i18n`.`TITLE` END ".Criteria::LIKE." ?", "%".$title."%", \PDO::PARAM_STR); + } $orders = $this->getOrder(); diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 071c88dd3..539436983 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -61,6 +61,7 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('not_empty', 0), Argument::createBooleanOrBothTypeArgument('visible', 1), + Argument::createAnyTypeArgument('title'), new Argument( 'order', new TypeCollection( @@ -115,6 +116,12 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface } } + $title = $this->getTitle(); + + if (!is_null($title)) { + $search->where("CASE WHEN NOT ISNULL(`requested_locale_i18n`.ID) THEN `requested_locale_i18n`.`TITLE` ELSE `default_locale_i18n`.`TITLE` END ".Criteria::LIKE." ?", "%".$title."%", \PDO::PARAM_STR); + } + $visible = $this->getVisible(); if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);