Contao extension

Custom module

Contao extension that allows you to include a custom file as a module. It is especially helpful when you need to use the PHP code or create a reusable content.

Create a template

To create a new template that can be attached as front end module, please go to the Templates module and create a new custom_default template. Rename it according to its purpose. Then, create a front end module and choose the appropriate template.

Put it online on your website and check the result:

Example usage

As an example, let's display a hello message to the user. If he is not logged in, then we'll say hello to guest and encourage him to sign in. If he is already logged in, we'll simply say hello with his name:

<?php if (FE_USER_LOGGED_IN): ?>
Hello {{user::firstname}}!
<?php else: ?>
Hello guest! Would you like to {{link_open::123}}sign in{{link_close}}?
<?php endif; ?>

Languages

PHP - 89.2%
Smarty - 5.4%
HTML - 5.4%

Releases (versions)

Name Last commit Download
1.2.0 () .zip .tar.gz
1.1.4 () .zip .tar.gz
1.1.3 () .zip .tar.gz

Branches

Name Last commit
develop No more changelog for small projects (cf18554)
master Merge branch 'develop' (69461f9)

To report bugs or request new features, please use the Github issues system as this will greatly improve the workflow and speed up the development process.

Details

Extension name: custom_module
Category: Application
Type: Free
License: LGPL
Current version: 1.1.4
Compatibility: Contao from 3.2.0 to 3.5.34
Languages: en en en
Installed: 516+ times