Skip to content

Add panel field 'width' attribute - #672

Merged
giuscris merged 2 commits into
getformwork:2.xfrom
RWDevelopment:2.x
Mar 22, 2025
Merged

Add panel field 'width' attribute#672
giuscris merged 2 commits into
getformwork:2.xfrom
RWDevelopment:2.x

Conversation

@RWDevelopment

@RWDevelopment RWDevelopment commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

according to #671 (comment) pull request

<div class="section-content">
   <div class="row">
      <?php foreach ($fields->getMultiple($section->get('fields', [])) as $field) : ?>
         <?php if ($field->isVisible()) : ?>
             <div <?= $this->attr(['class' => ['col-md-'.$field->get('width', '12-12')]]) ?>>
                   <?php $this->insert('fields.' . $field->type(), ['field' => $field]) ?>
              </div>
         <?php endif ?>
      <?php endforeach ?>
   </div>
</div>
published:
        type: checkbox
        label: '{{page.status.published}}'
        description: '{{page.status.published.description}}'
        default: true
        width: 6-12

routable:
        type: checkbox
        label: '{{page.routable}}'
        description: '{{page.routable.description}}'
        default: true
        width: 6-12

@giuscris

Copy link
Copy Markdown
Member

Thank you @RWDevelopment for the contribution

I've just fixed the spaces

@giuscris
giuscris merged commit a80177a into getformwork:2.x Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants