N1 Nex1on

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

Code
<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

  1. Copy the themes/rail folder under your own name and edit name and the titles in theme.json.
  2. Change only views/layouts/main.tpl.html (the arrangement) and the layer at the end of assets/css/theme.css. Shared style base: before theme.css the page loads assets/css/nx-base.css from 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 in theme.css with the same selector or slightly more specific (for example .banner--text { … }); !important is not needed. The base rules use plain selectors (classes, no #id), so your rule wins by order. Exceptions: three rules about the hidden attribute (hidden stays hidden) and the fields .home-files__meta and .nx-empty__add; override them the same way the base does (!important or :not(#nx)). You can start your own theme with an empty theme.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 !important and in any order. Shared buttons, fields and forms live in the “shared defaults” section of nx-base.css in 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.
  3. 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.
  4. Not allowed: PHP, <form>, <script>, <style>, event handlers. Forms are drawn only by the engine.

Updated 17.11.2026

Share: Telegram WhatsApp