Page
The “Side rail” theme (rail): a model tag-based theme
Ta sekcja jest na razie po angielsku.
The bundled themes differ in colour, font and details, but they all have the header on top and the menu in a row. “Side rail” is built differently: the menu stands on the left as a full-height column, and the content is on the right. The page frame lies entirely in one tag file: themes/rail/views/layouts/main.tpl.html. The rest of the theme: theme.json, assets/css/theme.css (the theme’s common styles plus the rail layer at the end of the file).
Page frame
<div class="rail-shell">
<aside class="rail">
<a class="rail__brand brand" href="{home}"><span class="brand-name">{site_name}</span></a>
<div class="rail__find">{search}</div>
<nav class="rail__nav">
[each:menu]<a class="rail__link" href="{item.url}">{item.title}</a>[/each]
</nav>
<div class="rail__side">{region:sidebar}</div>
<div class="rail__foot">
{languages}
[if:user.logged]<div class="rail__me">{user_menu}</div>[else]<div class="rail__login">{login}</div>[/if]
</div>
</aside>
<div class="rail-main">
<header class="rail-top">… brand, {menu_toggle}, {region:header}, {region:head_actions}</header>
<div class="rail-band">{region:before_content}</div>
<main id="content" class="rail-content">{content}</main>
<div class="rail-band">{region:after_content}</div>
<footer class="rail-foot site-foot"><div class="nx-foot-region">{region:footer}</div><div class="rail-foot__in">{site_footer}</div></footer>
</div>
</div>How it holds up on a phone
The left column works from 768 points. Below that the column turns into a compact “search · language · sign-in” row, with a top bar above it holding the name and a “Menu” button ({menu_toggle}, which also opens the sections). It is all done with styles: .rail-main { display: contents } and the block order order, so the markup is the same for all widths and no script is needed.
What is already provided and ready-made here
- the member menu
{user_menu}(with the sign-out button), sign-in{login}, search{search}, language picker{languages}— ready-made engine tags; the forms and protection keys stay with the engine; - the
{region:…}places — module blocks placed into the theme (banners, subscription, archive, poll); - the frame needs no interface words: all labels are already inside the ready-made tags, so the theme works in all seven languages without translations of its own.
How to make your own from this model
- Copy the
themes/railfolder under your own name and editnameand the titles intheme.json. - Change only
views/layouts/main.tpl.html(the arrangement) and the layer at the end ofassets/css/theme.css. Shared style base: beforetheme.cssthe page loadsassets/css/nx-base.cssfrom the core. It holds the rules that are the same in every bundled theme: the layout of section blocks (forum, shop, banners, search, the phone menu, empty states). They sit in an earlier layer than yours: to change any of them, write a rule intheme.csswith the same selector or slightly more specific (for example.banner--text { … });!importantis not needed. The base rules use plain selectors (classes, no#id), so your rule wins by order. Exceptions: three rules about thehiddenattribute (hidden stays hidden) and the fields.home-files__metaand.nx-empty__add; override them the same way the base does (!importantor:not(#nx)). You can start your own theme with an emptytheme.css: the base and the modules' own css give the sections a working look. Modules (news, shop, comments, forum, community, questions) bring their own css (modules/<module>/assets/<module>.css); it is loaded only when the module is on and is written in:where(), so it has zero specificity and any rule of your theme wins without!importantand in any order. Shared buttons, fields and forms live in the “shared defaults” section ofnx-base.cssin the same form. The order of layers:nx-base.css→theme.css→nex1on-ui.css→nx-geometry.css; the last two are the shared geometry of panels and narrow screens, and their rules of the form.x:not(#nx)are stronger than theme rules on purpose. - Cannot find the tag you need? See the list in the “Views on tags” reference. If the tag file is missing or broken (a block is not closed), the regular view works and the page does not break.
- Not allowed: PHP,
<form>,<script>,<style>, event handlers. Forms are drawn only by the engine.
In this section
- Themes
- Theme editor: change the look of your site right in the panel
- Tag-based views: how to redo a page without PHP
- View rules
- Main site template with tags
- Post template with tags: a film page
- The “Side rail” theme (rail): a model tag-based theme
- Extra fields
- Your own language from the panel
- Image compression
Updated 17.11.2026
Subscribe to the news
Only after email confirmation