Skip to main content

Template System Documentation

The serB2B template system is built on the Twig template engine. This section contains all the information you need to work with the template system.

🚀 Quick Start

You can follow the steps below to get started with the template system:

1️⃣ Twig Basics

Learn the fundamental structure and syntax of the Twig template engine.

➡️ Twig Basics

  • What is Twig and how does it work?
  • Basic syntax and operators
  • Variables, filters, and control structures
  • Include and extend systems

2️⃣ serB2B Custom Functions

Discover functions, filters, and global variables added specifically for serB2B.

➡️ serB2B Custom Functions

  • Global variables (user, site, e-commerce)
  • Custom functions (config, render, webpack, etc.)
  • Custom filters (translation, URL, price format, etc.)
  • Practical usage examples

3️⃣ Template Files Reference

Explore detailed descriptions and usage examples of existing template files.

➡️ Template View Files Reference

  • List and descriptions of all view files
  • Header variants and their features
  • Widget system and usage
  • Product, customer, and order templates

🛠️ Development Tips

  1. Start with the Basic Theme

    • Serves as the foundation for all new themes
    • Well-structured and documented
  2. Use Widgets

    • Avoid code repetition
    • Work with a modular structure
  3. Enable Debug Mode

    • Inspect variables with {{ dump(variable) }}
    • Identify errors easily
  4. Don't Forget the Cache

    • Clear the cache for template changes to appear
    • Disable the cache in the development environment
  5. Prioritize Security

    • Use the raw filter with caution
    • Always filter user inputs

📚 Additional Resources

External Resources

🤝 Support

For questions about the template system:

  • Contact the technical support team
  • Search the documentation
  • Review example templates

This documentation provides all the information you need to work efficiently with the serB2B template system. Follow the links above for detailed information.