diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 12086193d..5d2322c0b 100644 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -5,12 +5,10 @@ xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd"> - + - - diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 962acc794..6b6263857 100644 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -25,11 +25,39 @@ namespace Thelia\Core\Template\Loop; - -use Thelia\Log\Tlog; use Thelia\Tpex\Element\Loop\BaseLoop; use Thelia\Model\CategoryQuery; +/** + * + * Category loop, all params available : + * + * - id : can be an id (eq : 3) or a "string list" (eg: 3, 4, 5) + * - parent : categories having this parent id + * - current : current id is used if you are on a category page + * - not_empty : if value is 1, category and subcategories must have at least 1 product + * - visible : default 1, if you want category not visible put 0 + * - order : all value available : + * * alpha : sorting by title alphabetical order + * * alpha_reverse : sorting by title alphabetical reverse order + * * reverse : sorting by position descending + * * by default results are sorting by position ascending + * - random : if 1, random results. Default value is 0 + * - exclude : all category id you want to exclude (as for id, an integer or a "string list" can be used) + * - limit : number of results. Default value is 10 + * - offset : at witch id start the search + * + * example : + * + * + * #TITLE : #ID + * + * + * + * Class Category + * @package Thelia\Core\Template\Loop + * @author Manuel Raynaud + */ class Category extends BaseLoop { public $id; @@ -41,7 +69,7 @@ class Category extends BaseLoop { public $order; public $random; public $exclude; - public $start; + public $limit; public $offset; public function defineArgs() @@ -64,7 +92,7 @@ class Category extends BaseLoop { /** * * - * @param \Thelia\Tpex\Element\Loop\text $text + * @param string $text * @return mixed|string */ public function exec($text) @@ -72,7 +100,7 @@ class Category extends BaseLoop { $search = CategoryQuery::create(); if (!is_null($this->id)) { - $search->filterById($this->id); + $search->filterById($this->id, \Criteria::IN); } if(!is_null($this->parent)) { diff --git a/core/lib/Thelia/Core/Template/TestLoop/Equal.php b/core/lib/Thelia/Core/Template/TestLoop/Equal.php new file mode 100644 index 000000000..5e812a7a4 --- /dev/null +++ b/core/lib/Thelia/Core/Template/TestLoop/Equal.php @@ -0,0 +1,51 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\TestLoop; + +use Thelia\Tpex\Element\TestLoop\BaseTestLoop; + +/** + * + * TestLoop equal, test if value and variable are equal + * + * example : + * + * + * Result display here if variable and value are equal + * + * Result display here if variable and value are not equal + * + * + * Class Equal + * @package Thelia\Core\Template\TestLoop + * @author Manuel Raynaud + */ +class Equal extends BaseTestLoop +{ + + public function exec($variable, $value) + { + return $variable == $value; + } +} \ No newline at end of file diff --git a/templates/default/index.html b/templates/default/index.html index 76a107aba..981dc914d 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -7,7 +7,7 @@
TODO write content
- + #__COUNT__ - #TITLE
nb child : #NB_CHILD