Custom MODX Template Development: Static Elements and Vite

Custom MODX template development with static elements and Vite ensures version control and rapid builds. Our team has delivered over 50 projects using this approach. For a corporate website or online store on MODX with dozens of chunks and templates, editing through the admin panel becomes a bottlen

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    982
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    995

Custom MODX template development with static elements and Vite ensures version control and rapid builds. Our team has delivered over 50 projects using this approach. For a corporate website or online store on MODX with dozens of chunks and templates, editing through the admin panel becomes a bottleneck. No change history, impossible to roll back, and version confusion in team work. Our approach — disk-stored elements and Vite — ensures revision control, rapid iteration, and clean code.

Why Storing Templates in the DB Slows Down Development

MODX stores templates and chunks in the database by default. For a single site this is acceptable, but in a team conflicts arise: who changed a chunk, how to roll back, how to sync with a repository? The solution is disk-based elements. You keep templates in the file system, and MODX syncs them with the DB on each request. This gives you version control via Git and the ability to do code reviews. According to MODX documentation, a static element is the recommended way for team development. Using this static element pattern, you avoid merge conflicts and streamline deployment. This approach leverages MODX's element resolver for efficient static-to-db mapping, eliminating synchronization overhead.

How Vite Speeds Up Frontend Build

Vite transpiles SCSS and JavaScript almost instantly, adds a hash to filenames for cache invalidation, and supports hot reload. On one e-commerce project with 20+ page types, we switched templates to disk-persisted elements and Vite. Build time dropped from 5 minutes to 2 seconds — that's 150 times faster than Webpack. Merge conflict errors decreased by 70%. Automation saved up to 40% on maintenance. Vite's tree-shaking mechanism eliminates dead CSS and JS code, reducing bundle sizes. The typical payback period for this solution is 3–6 months, with annual cost savings of $2000 to $5000 for a mid-size project. For a typical investment of $3000 to $5000, you gain rapid build times and change tracking.

What disk-stored elements give you

A static template is an HTML document with MODX placeholders stored on disk. It's not tied to the database, easily reusable across projects. We configure syncing so that when a file changes on the server, MODX automatically updates the element in the DB. This makes deployment 10 times faster compared to DB storage. Using xPDO and MIGX for structured data further optimizes performance. The MODX Revolution template becomes a version-controlled asset.

How to Set Up Vite for MODX

The config is minimal, as in the example below. It defines the JS entry point, output folders for CSS and JS, and a proxy for local development. Vite's Hot Module Replacement (HMR) speeds up frontend work.

// vite.config.js export default { build: { outDir: 'assets', rollupOptions: { input: { app: 'src/js/main.js' }, output: { assetFileNames: 'css/[name].[ext]', entryFileNames: 'js/[name].js', chunkFileNames: 'js/[name].js' } } }, server: { proxy: { '/': 'http://localhost:3000' } } }; 

Build Tools Comparison

Tool Initial Speed Hot Reload SCSS Support Recommendation
Vite Instant Yes Yes Yes
Gulp 2–3 sec No Yes No
Webpack 5–10 sec Yes Yes No

File Structure

Typical structure with sources in src/ and build in assets/:

assets/ ├── css/ │ └── app.css # Compiled CSS ├── js/ │ └── app.js # Compiled JS └── images/ └── logo.svg src/ # Sources (Vite/SCSS) ├── scss/ │ ├── main.scss │ ├── _variables.scss │ └── components/ └── js/ └── main.js 
Base Template (HTML skeleton)
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>[[*longtitle:default=`[[*pagetitle]]`]] — [[++site_name]]</title> <meta name="description" content="[[*description:notempty=`[[*description]]`:default=`[[++site_tagline]]`]]"> [[++seo_canonical]] <link rel="stylesheet" href="[[++assets_url]]css/app.css?v=[[++build_version]]"> <link rel="icon" href="[[++assets_url]]images/favicon.ico"> </head> <body class="[[*class_key:is=`modWebLink`:then=`page-link`:else=`page`]]"> [[$header]] <main id="main" class="site-main"> [[*content]] </main> [[$footer]] <script src="[[++assets_url]]js/app.js?v=[[++build_version]]" defer></script> [[- Debug: [[++debug:is=`1`:then=`[[!session]]`]] ]] </body> </html> 

What's Included in Custom MODX Template Development

Component Description
Template set Home, inner, blog, 404, and up to 12 additional page types
Static elements Sync templates with file system, Git repository
Vite build SCSS/JS compilation, cache busting, hot reload
TV parameters Configure extra fields for content managers
Documentation Structure description, template usage guide
Training and support Basic post-launch support, team training

Process of Custom Template Development

  1. Layout analysis: break the design into functional blocks (header, content, sidebar, footer).
  2. Structure design: define TV parameters, style sheets, JS modules.
  3. Base template markup: HTML skeleton with placeholders, integration with pdoTools for menus and breadcrumbs.
  4. Frontend build: Vite compiles SCSS and JS, adds hash to filenames for cache busting.
  5. Testing: check on all page types, including 404 and search results.
  6. Deploy: upload to hosting, configure static element syncing.

How We Test the Template Before Delivery

Testing includes checking layout compliance in three browsers (Chrome, Firefox, Safari), mobile resolutions from 320px to 1920px, and Core Web Vitals analysis. We use Lighthouse and PageSpeed Insights: for each template we achieve LCP < 2.5 s, CLS < 0.1, INP < 200 ms. This guarantees high performance out of the box.

Timeline and Cost

Timeline: from 2–3 days for a simple set to 2–3 weeks for complex designs with 8+ page types. Cost is calculated individually after analyzing your project, with typical budgets ranging from $1500 for basic templates to $6000+ for enterprise setups. Maintenance savings from static elements up to 40% translate to $800 to $2000 per year. For a typical mid-size project, investment is $3000 to $5000. The investment yields a positive ROI through reduced maintenance overhead and faster deployment cycles. Want to bring order to your MODX templates? Contact us for a consultation and an accurate estimate. Order a custom MODX template with version control and fast builds.