From 811186f4aa1c342b95f16318b3e55ff8b43c60f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Le=CC=81on?= Date: Sun, 18 May 2014 13:34:41 +0200 Subject: [PATCH 1/2] Allow sorting by creation date for Content Loop --- core/lib/Thelia/Core/Template/Loop/Content.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index 377737088..1fae744f5 100644 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -60,7 +60,7 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual_reverse', 'random', 'given_id')) + new Type\EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual_reverse', 'random', 'given_id', 'created', 'created_reverse', 'updated', 'updated_reverse')) ), 'alpha' ), @@ -178,6 +178,19 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); break(2); + //OMNIMOD + case "created": + $search->addAscendingOrderByColumn('created_at'); + break; + case "created_reverse": + $search->addDescendingOrderByColumn('created_at'); + break; + case "updated": + $search->addAscendingOrderByColumn('updated_at'); + break; + case "updated_reverse": + $search->addDescendingOrderByColumn('updated_at'); + break; } } From 957140a5b7bfd00ea2a63f0100fa6adf7a8d4edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Le=CC=81on?= Date: Sun, 18 May 2014 13:43:56 +0200 Subject: [PATCH 2/2] Allow sorting by creation date for Content Loop --- core/lib/Thelia/Core/Template/Loop/Content.php | 1 - 1 file changed, 1 deletion(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index 1fae744f5..df0f18aff 100644 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -178,7 +178,6 @@ class Content extends BaseI18nLoop implements PropelSearchLoopInterface $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); break(2); - //OMNIMOD case "created": $search->addAscendingOrderByColumn('created_at'); break;