<div class="container-fluid bg-light py-4 py-md-5">
  <div class="row justify-content-center">
    <?php foreach ($viewContents as $contents) { ?>
      <div class="col-md-8 mb-4">
        <div class="text-center mt-5">
          <!-- <h1></h1>?=h($menuDetails->name)?></h1> -->

          <!-- Section title -->
          <h1 class="card-title text-dark pb-3 fw-bold">
            <?= h($contents->name) ?>
          </h1>
          <!-- End Section title -->

          <!-- Section content -->
          <p class="text-muted text-wrap fs-5">
            <?= $this->Text->truncate(h(strip_tags($contents->content)), 350, ['ellipsis' => '...', 'exact' => false]) ?>
          </p>
          <!-- End Section content -->
          <a href="<?= $this->Url->build([
            'controller' => $this->request->getParam('subsection') ?:
              ($this->request->getParam('section') ?:
                $this->request->getParam('controller')),
            'action' => 'details',
            $contents->id
          ]) ?>">

            <button class="btn btn-dark me-md-2 mt-3" type="button">Read More</button>
          </a>

        </div>
      </div>
    <?php } ?>
  </div>
</div>