const el = document.getElementById('post');
console.log(el.name.replace(/.+?\[(\d+)\]/, '$1'));
<?php
$res_id = 1; // заменить на свой id заглушки
$uri = $modx->makeUrl($res_id, '', '', 'abs');
if ($modx->user->hasSessionContext('mgr') || $modx->user->isMember('Administrator')) return;
if($_SERVER['REQUEST_URI'] == $uri || $_SERVER['REQUEST_URI'] == MODX_MANAGER_URL) return;
$modx->sendRedirect( $uri );
@EVAL return $modx->runSnippet('snippet-name', array('key'=>'value'));
<div class="section-5_content-wrap">
<div class="section-5_content flex">
{if $avto_slide}
<div class="section-5_slider-wrap">
<div id="section-5_slider" class="owl-carousel">
{set $rows = $avto_slide | json_decode}
{foreach $rows as $row}
<picture class="section-5_img">
<img src="{$row.avto_img}" alt="{$row.avto_title}">
</picture>
{/foreach}
</div>
<div class="section-5_slider_dots flex"></div>
</div>
{/if}
<div class="section-5_text">
<p class="section-5_text-title">Характеристика<br>
авто</p>
{$char_avto}
</div>
</div>
<div class="section-btn">
<button class="btn-order" onclick="location.href='{16 | url}'">Забронировать авто</button>
</div>
</div>