Onepager site: use only default snippet

Following the onepager template and everything works fine when I created a static snippet for each page I want to use. Although I’d only like to use one snippet and one set of blueprints with different settings:

  1. User creates multiple pages
  2. home.php is used to create a single page website
<?php snippet('header') ?>
<!-- html for each content section -->
<?php foreach($pages->listed() as $section): ?>
    <?php snippet($section->id(), ['data' => $section]); ?>
<?php endforeach ?>
<?php snippet('footer') ?>
  1. in my snippets folder I only have /snippets/default.php snippet with different options using one set of blueprints with the Layouts option
<?php foreach ($data->layout()->toLayouts() as $layout): ?>
<section id="<?= $data->title()->html() ?>" class="6-column-grid" id="<?= $layout->id() ?>">
  <?php foreach ($layout->columns() as $column): ?>
  <div class="column" style="--span:<?= $column->span(6) ?>">
    <div class="blocks">
      <?= $column->blocks() ?>
    </div>
  </div>
  <?php endforeach ?>
</section>
<?php endforeach ?>

Is this dynamically achievable, currently seems that i’d have to fix the settings for each snippet (about, contact etc).

Best

Instead of $section->id(), call the default.php snippet:

<?php snippet('default', ['data' => $section]); ?>

Note that in your snippet, the section element has two id attributes!