MODX Chunks and Templates Configuration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
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.

Showing 1 of 1 servicesAll 2065 services
MODX Chunks and Templates Configuration
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

MODX Chunks and Templates Configuration

Chunks are reusable HTML blocks without PHP logic. Templates are HTML wrappers for pages with placeholders. Proper organization of chunks and templates is the foundation of a maintainable MODX project.

Chunk Organization

Name chunks with prefixes to categorize by type:

Header and footer:
header               - main header
header.mobile        - mobile header version
footer
footer.minimal       - minimal footer for landing pages

Cards and blocks:
card.product         - product card
card.article         - article card
card.team            - employee card
block.cta            - call to action
block.features       - features block
block.testimonials   - testimonials

Forms:
form.contact         - contact form
form.callback        - callback form

Email templates:
email.contact        - email after request
email.order          - order confirmation

Product Card Chunk

[[- card.product ]]
<article class="product-card">
    [[+image:notempty=`
    <figure class="product-card__image">
        <a href="[[+link]]">
            <img src="[[+image]]" alt="[[+pagetitle]]" loading="lazy" width="400" height="300">
        </a>
    </figure>
    `]]

    <div class="product-card__body">
        <h3 class="product-card__title">
            <a href="[[+link]]">[[+pagetitle]]</a>
        </h3>

        [[+introtext:notempty=`<p class="product-card__desc">[[+introtext]]</p>`]]

        [[+price:notempty=`
        <p class="product-card__price">
            [[+price:number_format=`0,.`, ` `]] ₽
        </p>
        `]]

        <a href="[[+link]]" class="btn btn--primary">More Info</a>
    </div>
</article>

Templates: One or Many?

Recommended approach — multiple specialized templates:

Template Usage
base Base (not used directly)
home Homepage
inner Typical inner page
catalog Category/product list
detail Product/article detail page
landing Landing without header/footer
blog Blog with article list
error Error pages (404, 503)

Passing Data from Template to Chunk

[[- In template ]]
[[$block.features?
    &title=`Why Choose Us`
    &items=`[[*tv.features_json]]`
    &columns=`3`
]]
[[- Chunk block.features ]]
<section class="features features--[[+columns]]col">
    <h2>[[+title]]</h2>
    <div class="features__grid">
        [[+items]]
    </div>
</section>

Chunk Conditions

[[- Show "New" badge if resource created less than 30 days ago ]]
[[+createdon:gt=`[[*id:math=`[[!+current_timestamp]] - 2592000`]]`:then=`<span class="badge badge--new">New</span>`]]

[[- Or through TV ]]
[[+tv.is_new:is=`1`:then=`<span class="badge">New</span>`]]

Storage in Files

assets/
├── chunks/
│   ├── header.html
│   ├── footer.html
│   └── card.product.html
└── templates/
    ├── home.html
    └── inner.html

In chunk editor: Source Type = File, Filename = assets/chunks/header.html.

Timeline

Creating and organizing 15–25 chunks for typical website — 3–5 days (as part of template development).