# Structure

Besides hostware huge module system, hostware also offers an extensible theme management. Themes can basically extend any page in the shop, starting from the default theme and ending in module template files.

Every module, theme and the default storefront has a so called "template namespace". The namespace for the default page of any saleschannel is `storefront::home.twig`. \
As you may have noticed, the part before `::` is the namespace and the part behind that is the actual file path.

### Template system

In comparison to other hosting automation solutions, hostware features a highly extendable template system using the [Twig](https://twig.symfony.com/) engine.\
Twig is very good in structuring templates with [blocks](https://twig.symfony.com/doc/3.x/tags/block.html) and basic logic like [for loops](https://twig.symfony.com/doc/2.x/tags/for.html), [if conditions](https://twig.symfony.com/doc/2.x/tags/if.html) and custom [reusable components](https://twig.symfony.com/doc/2.x/tags/include.html)

## Namespaces

Every template can be extended using the correct namespace.

### Module namespaces

Every module and theme uses the directory / module / theme name as the namespace. The module "DashservVps" e.g. has the template namespace "dashservvps::path/to/template.twig" and is routed in the /resources/views of the module.

### Theme namespaces

Themes have a slightly different namespace. To differentiate them from modules, the prefix "theme." is added. For example, the Theme called "horizon" has the namespace "theme.horizon::path/to/template.twig"

### Storefront namespace

The basic hostware templates can be easily extended by a theme or module using the namespace "storefront::path/to/template.twig"
