PHPackages                             thelia/feature-type-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thelia/feature-type-module

ActiveThelia-module[Utility &amp; Helpers](/categories/utility)

thelia/feature-type-module
==========================

2.0.2(1y ago)02.6k7[1 PRs](https://github.com/thelia-modules/FeatureType/pulls)1LGPL-3.0+PHPCI passing

Since May 14Pushed 3w ago6 watchersCompare

[ Source](https://github.com/thelia-modules/FeatureType)[ Packagist](https://packagist.org/packages/thelia/feature-type-module)[ RSS](/packages/thelia-feature-type-module/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (1)Versions (19)Used By (1)

Feature Type
============

[](#feature-type)

Authors: Thelia , Gilles Bourgeat

- This module allows you to add to your features the features types.
- Example : Color, Image link to the textures ...
- An feature can have several types.
- An feature type can have values or not.
- Values can be unique by language.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9bc174175146c0a5de52a46687ff2970395e7c8f54f835ce4f1cf1d7882ddba1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7468656c69612d6d6f64756c65732f46656174757265547970652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thelia-modules/FeatureType/?branch=master)[![License](https://camo.githubusercontent.com/958a9f850ef61ae634b585c03ff9235412034618348882953710f2e5082eaaa5/68747470733a2f2f706f7365722e707567782e6f72672f7468656c69612f666561747572652d747970652d6d6f64756c652f6c6963656e7365)](https://packagist.org/packages/thelia/feature-type-module)[![Latest Stable Version](https://camo.githubusercontent.com/90ef419fdef3cb5b497b6265a393434273721ffaa0feb7f3bf7088898c0af1ab/68747470733a2f2f706f7365722e707567782e6f72672f7468656c69612f666561747572652d747970652d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/thelia/feature-type-module)

Compatibility
-------------

[](#compatibility)

Thelia &gt;= 2.1

Installation
------------

[](#installation)

### Manually

[](#manually)

- Copy the module into `/local/modules/` directory and be sure that the name of the module is `FeatureType`.
- Activate it in your thelia administration panel

### Composer

[](#composer)

Add it in your main thelia composer.json file

```
composer require thelia/feature-type-module:~1.3.0

```

Usage
-----

[](#usage)

- Once activated, click on the configure button for add or edit the features types.
- For associate an feature to an feature type, edit an feature.

Hooks
-----

[](#hooks)

### backoffice :

[](#backoffice-)

- feature-type.form-top (in form : create, update, feature type) (params : feature\_type\_id)
- feature-type.form-bottom (in form : create, update, feature type) (params : feature\_type\_id)
- feature-type.configuration-top
- feature-type.configuration-bottom
- feature-type.list-action (by feature type) (params : feature\_type\_id)
- feature-type.configuration-js

Loop
----

[](#loop)

### feature\_type

[](#feature_type)

#### Input arguments

[](#input-arguments)

ArgumentDescription**id**A single or a list of ids.**exclude\_id**A single or a list of ids.**slug**String**feature\_id**A single or a list of features ids.#### Output arguments

[](#output-arguments)

VariableDescriptionIDThe feature type idSLUGThe feature type slugTITLEThe feature type titleDESCRIPTIONThe feature type descriptionCSS\_CLASSThe feature type css classPATTERNThe feature type patternINPUT\_TYPEThe feature type input typeMINThe feature type minimum valueMAXThe feature type maximum valueSTEPThe feature type step valueIMAGE\_MAX\_WIDTHThe max width for image (in px)IMAGE\_MAX\_HEIGHTThe max height for image (in px)IMAGE\_RATIOThe image ratio requiredIS\_MULTILINGUAL\_FEATURE\_AV\_VALUEIndicates whether the values are unique for each languageHAS\_FEATURE\_AV\_VALUEIndicates whether the type feature has values for each feature av### feature\_extend\_feature\_type

[](#feature_extend_feature_type)

Extends the Thelia loop : [Feature](http://doc.thelia.net/en/documentation/loop/feature.html)

#### Other input arguments

[](#other-input-arguments)

ArgumentDescription**feature\_type\_id**A single or a list of features type ids.**feature\_type\_slug**A single or a list of features type slugs.#### Other output arguments

[](#other-output-arguments)

- The features types associated.
- The variable name is equal to the name of the slug,
- The value is boolean, true for associated, false for unassociated.

#### Example

[](#example)

```
    {loop name="feature_extend_feature_type" type="feature_extend_feature_type" feature_type_id="1,2,3"}
        {$TITLE}

        {if $COLOR}
            The feature has type color
        {/if}

        {if $MY_FEATURE_TYPE}
            The feature has type "My feature type"
        {/if}
    {/loop}
```

### feature\_availability\_extend\_feature\_type

[](#feature_availability_extend_feature_type)

Extends the Thelia loop : [Feature availability](http://doc.thelia.net/en/documentation/loop/feature_availability.html)

#### Other input arguments

[](#other-input-arguments-1)

ArgumentDescription**feature\_type\_id**A single or a list of features type ids.**feature\_type\_slug**A single or a list of features type slugs.#### Other output arguments

[](#other-output-arguments-1)

- The features types associated.
- The variable name is equal to the name of the slug,
- The variable contains the value.

#### Example

[](#example-1)

```
    title : color : my feature type
    {loop name="feature_availability_extend_feature_type" type="feature_availability_extend_feature_type" feature="1"}
        {$TITLE} : {$COLOR} : {$MY_FEATURE_TYPE}
    {/loop}

    title : color : my feature type
    {loop name="feature_availability_extend_feature_type" type="feature_availability_extend_feature_type" feature_type_slug="color"}
        {$TITLE} : {$COLOR} : {$MY_FEATURE_TYPE}
    {/loop}
```

### feature\_value\_extend\_feature\_type

[](#feature_value_extend_feature_type)

Extends the Thelia loop : [Feature value](http://doc.thelia.net/en/documentation/loop/feature_value.html)

#### Other output arguments

[](#other-output-arguments-2)

- The features types associated.
- The variable name is equal to the name of the slug,
- The variable contains the value.

#### Example

[](#example-2)

```
    title : color
    {loop name="feature_value_extend_feature_type" type="feature_value_extend_feature_type" feature="1" product="1"}
        {$TITLE} : {$COLOR}
    {/loop}
```

Model
-----

[](#model)

### FeatureType::getValue

[](#featuretypegetvalue)

```
    /**
     * Returns a value based on the slug, feature_av_id and locale
     *
     *
     * $value  = FeatureType::getValue('color', 2);
     *
     *
     * @param string $slug
     * @param int $featureId
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValue($slug, $featureId, $locale = 'en_US')
```

### FeatureType::getValues

[](#featuretypegetvalues)

```
    /**
     * Returns a set of values
     * If the value does not exist, it is replaced by null
     *
     *
     * $values = FeatureType::getValue(['color','texture'], [4,7]);
     *
     *
     *
     *  array(
     *  'color' => [4 => '#00000', 7 => '#FFF000'],
     *  'texture' => [4 => null, 7 => 'lines.jpg']
     * )
     *
     *
     * @param string[] $slugs
     * @param int[] $featureIds
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValues(array $slugs, array $featureIds, $locale = 'en_US')
```

### FeatureType::getFirstValues

[](#featuretypegetfirstvalues)

```
    /**
     * Returns a set of first values
     * If the value does not exist, it is replaced by null
     *
     *
     * $values = FeatureType::getFirstValues(['color','texture', 'other'], [4,7]);
     *
     *
     *
     *  array(
     *  'color' => '#00000',
     *  'texture' => 'lines.jpg',
     *  'other' => null
     * )
     *
     *
     * @param string[] $slugs
     * @param int[] $featureIds
     * @param string $locale
     * @return array
     */
    public static function getFirstValues(array $slugs, array $featureIds, $locale = 'en_US')
```

### FeatureType::getFeatureAv

[](#featuretypegetfeatureav)

```
    /**
     * Find FeatureAv by slugs, featureIds, values, locales
     *
     *
     * $featureAv = FeatureType::getFeatureAv('color', '1', '#00000');
     *
     *
     * @param null|string|array $slugs
     * @param null|string|array $featureIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\FeatureAv
     */
    public static function getFeatureAv($slugs = null, $featureIds = null, $values = null, $locale = 'en_US')
```

### FeatureType::getFeatureAvs

[](#featuretypegetfeatureavs)

```
    /**
     * Find FeatureAv by slugs, featureIds, values, locales
     *
     *
     * $featureAv = FeatureType::getFeatureAvs('color', '1', '#00000');
     *
     *
     * @param null|string|array $slugs
     * @param null|string|array $featureIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\FeatureAv
     */
    public static function getFeatureAvs($slugs = null, $featureIds = null, $values = null, $locale = 'en_US')
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance73

Regular maintenance activity

Popularity22

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 71.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~242 days

Recently: every ~399 days

Total

16

Last Release

427d ago

Major Versions

1.3.3 → 2.0.02021-04-28

1.3.4 → 2.0.12025-04-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2196919?v=4)[thelia](/maintainers/thelia)[@thelia](https://github.com/thelia)

---

Top Contributors

[![gillesbourgeat](https://avatars.githubusercontent.com/u/7335734?v=4)](https://github.com/gillesbourgeat "gillesbourgeat (32 commits)")[![lopes-vincent](https://avatars.githubusercontent.com/u/6057206?v=4)](https://github.com/lopes-vincent "lopes-vincent (10 commits)")[![NicolasBarbey](https://avatars.githubusercontent.com/u/26166378?v=4)](https://github.com/NicolasBarbey "NicolasBarbey (2 commits)")[![anoziere](https://avatars.githubusercontent.com/u/118798868?v=4)](https://github.com/anoziere "anoziere (1 commits)")

### Embed Badge

![Health badge](/badges/thelia-feature-type-module/health.svg)

```
[![Health](https://phpackages.com/badges/thelia-feature-type-module/health.svg)](https://phpackages.com/packages/thelia-feature-type-module)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
