Theme Structure
A Finqu theme is organized into a set of well-defined directories, each serving a specific purpose. Understanding this structure is essential for developing, customizing, and maintaining themes efficiently.
Directory Overview
The typical theme directory contains the following folders:
Required Files and Folders
layout/theme.liquid: The main layout file. Additional layouts can be defined as needed.config/settings_schema.jsonandconfig/settings_data.json: Define and store theme settings.- At least one template in the
templatesdirectory (e.g.,frontpage.liquid). - Locale file for each supported language in
locales(e.g.,en.json).
Optional Components
- Blocks: Modular components for use within sections. Useful for creating dynamic, customizable content areas.
- Snippets: Reusable code pieces for icons, widgets, or other small features.
- Additional layouts: For special page types (e.g.,
campaign.liquid).
Configuration Files
settings_schema.json: Defines the structure and available options for theme settings.settings_data.json: Stores the actual values for the theme settings..datadirectory (optional): Used by the Finqu editor to store drafts.
Best Practices
- Use the
assetsdirectory for all static files. Sass files are compiled with Dart Sass, and.liquidfiles are processed and cachebusted automatically. - Reference assets using the
asset_urlfilter:{{ 'my_file.svg' | asset_url }}. - Organize blocks and sections for maximum reusability and maintainability.
- Use the translation system in
localesto support multiple languages and dynamic content. - Keep configuration files up to date and well-documented.
Related Articles
- Blocks: Learn how to create and use modular blocks within your theme.
- Sections: Understand how to structure and configure sections for flexible layouts.
- Settings: Configure theme settings and provide customization options for users.
- Templates: Explore how to build and organize page templates for different store views.