I have a question. I want to know what I did wrong.
I want to upload the image to the archive at once and bring the image from the archive from the three slides in the page.
This is the panel composition.
title: Post
icon: ๐
status:
draft:
label: ์ด์
unlisted:
label: ๋น๊ณต๊ฐ
listed:
label: ๊ณต๊ฐ
tabs:
mainpage:
label: list
icon: text
columns:
- width: 1/2
fields:
thumbnailset:
label: ์ฌ๋ค์ผ ์ด๋ฏธ์ง ๊ฐฏ์๋ฅผ ๋จผ์ ์ ํํ ํ, ์ ํํ ๊ฐฏ์์ ํด๋นํ๋ ์นธ์ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํฉ๋๋ค.
type: radio
options:
onbtnfour: ์ด๋ฏธ์ง 4์ฅ
onbtnthree: ์ด๋ฏธ์ง 3์ฅ
onbtntwo: ์ด๋ฏธ์ง 2์ฅ
onbtnone: ์ด๋ฏธ์ง 1์ฅ
xbtn: ์ด๋ฏธ์ง ์์
- width: 1/2
fields:
thumbcolor:
label: ์ด๋ฏธ์ง๊ฐ ์์ ๊ฒฝ์ฐ ์ํ๋ ์์์ ์ ํํ์ธ์. ๋จ์ ์นด๋๋ก ๋ณด์ฌ์ง๋๋ค.
type: color
editableAlpha: true # (optional) if set to false, alpha value controls are not displayed
default: "#fff"
- width: 1/4
fields:
coverone:
label: ์ฌ๋ค์ผ - 1 / 4
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
uploads: false
max: 1
image:
ratio: 5/4
cover: true
size: small
help: ํ ์ฅ๋ง ์ ํ๋ฉ๋๋ค.
- width: 1/4
fields:
covertwo:
label: ์ฌ๋ค์ผ - 2 / 4
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
uploads: false
max: 1
image:
ratio: 5/4
cover: true
size: small
help: ํ ์ฅ๋ง ์ ํ๋ฉ๋๋ค.
- width: 1/4
fields:
coverthree:
label: ์ฌ๋ค์ผ - 3 / 4
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
uploads: false
max: 1
image:
ratio: 5/4
cover: true
size: small
help: ํ ์ฅ๋ง ์ ํ๋ฉ๋๋ค.
- width: 1/4
fields:
coverfour:
label: ์ฌ๋ค์ผ - 4 / 4
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
uploads: false
max: 1
image:
ratio: 5/4
cover: true
size: small
help: ํ ์ฅ๋ง ์ ํ๋ฉ๋๋ค.
postpage:
label: post
icon: text
columns:
- width: 1/2
fields:
maincover:
label: ํ์ง
type: radio
options:
onbtn: ์ด๋ฏธ์ง ํ์ง
offbtn: ๋จ์ ํ์ง
xbtn: ํ์ง์์
- width: 1/2
fields:
covers:
label: ์ด๋ฏธ์ง ํ์ง
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
help: ํ ์ฅ๋ง ์ ํ๋ฉ๋๋ค.
color:
label: ๋จ์ ํ์ง
type: color
editableAlpha: true # (optional) if set to false, alpha value controls are not displayed
default: "#fff"
- width: 1/1
fields:
rightpage:
label: ์ฐ์ธก ๊ณ ์ ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
type: files
layout: cards
template: rightimage
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
min: 1
help: ์ค๋ฅธ์ชฝ ์์ญ์ ๋ณด์ฌ์ง๋ ๊ณ ์ ์ฌ๋ผ์ด๋์
๋๋ค.
- width: 1/1
fields:
mainimageset:
label: ์ด๋ฏธ์ง ์์ญ 1(์๋ ์ธ ๊ฐ์ง ์ ํ ์ค์ ํ๋๋ฅผ ์ ํํ์ธ์)
type: radio
options:
onbtn: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
offbtn: ์ด๋ฏธ์ง ๋ฑ์ฅ
xbtn: ์ด๋ฏธ์ง ์์
- width: 1/2
fields:
mainslide:
label: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
type: files
layout: cards
template: mainslides
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 1/1
cover: true
size: small
help: ์ฌ๋ฌ ์ฅ์ ์ด๋ฏธ์ง๋ฅผ ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
- width: 1/2
fields:
mainpiece:
label: ์ด๋ฏธ์ง ๋ฑ์ฅ
type: files
layout: cards
template: mainpieces
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 1/1
cover: true
size: small
max: 1
help: ํ ์ฅ์ ์ด๋ฏธ์ง๋ง ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
- width: 1/1
fields:
subimageset:
label: ์ด๋ฏธ์ง ์์ญ 2(์๋ ์ธ ๊ฐ์ง ์ ํ ์ค์ ํ๋๋ฅผ ์ ํํ์ธ์)
type: radio
options:
onbtn: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
offbtn: ์ด๋ฏธ์ง ๋ฑ์ฅ
xbtn: ์ด๋ฏธ์ง ์์
- width: 1/2
fields:
subslide:
label: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
type: files
layout: cards
template: subslides
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
help: ์ฌ๋ฌ ์ฅ์ ์ด๋ฏธ์ง๋ฅผ ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
- width: 1/2
fields:
subpiece:
headline: ์ด๋ฏธ์ง ๋ฑ์ฅ
type: files
layout: cards
template: subpieces
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
max: 1
help: ํ ์ฅ์ ์ด๋ฏธ์ง๋ง ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
- width: 1/1
fields:
thimageset:
label: ์ด๋ฏธ์ง ์์ญ 3(์๋ ์ธ ๊ฐ์ง ์ ํ ์ค์ ํ๋๋ฅผ ์ ํํ์ธ์)
type: radio
options:
onbtn: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
offbtn: ์ด๋ฏธ์ง ๋ฑ์ฅ
xbtn: ์ด๋ฏธ์ง ์์
- width: 1/2
fields:
thslide:
label: ์ด๋ฏธ์ง ์ฌ๋ผ์ด๋
type: files
layout: cards
template: thimage
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
help: ์ฌ๋ฌ ์ฅ์ ์ด๋ฏธ์ง๋ฅผ ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
- width: 1/2
fields:
thpiece:
headline: ์ด๋ฏธ์ง ๋ฑ์ฅ
type: files
layout: cards
template: thpiece
info: "{{ file.dimensions }}"
uploads: false
image:
ratio: 5/4
cover: true
size: small
max: 1
help: ํ ์ฅ์ ์ด๋ฏธ์ง๋ง ์ฌ๋ฆด ๋ ์ฌ์ฉํฉ๋๋ค.
filepage:
label: file
icon: text
columns:
- width: 1/1
sections:
allfiles:
headline: ์ด๋ฏธ์ง ์์นด์ด๋ธ
type: files
layout: cards
# template: image
info: "{{ file.dimensions }}"
image:
ratio: 5/4
cover: true
size: small
help: ์ต๋ 1600px ์ดํ ํฌ๊ธฐ ์ด๋ฏธ์ง๋ก ์
๋ก๋ ๊ถ์ฅ, ํ์ผ๋ช
์๋ฌธ ์๋ฌธ์, ์ธ๋๋ฐ, ์ซ์๋ง ์ฌ์ฉ
And on the webpage(post.php), the slide code below was used the same, and I tried to change the โtemplateโ part.
<div class="swiper-container">
<div class="swiper-wrapper">
<?php $images = $page->files()->filterBy('template', 'rightimage') ?>
<?php if ($images->isNotEmpty()) : ?>
<?php foreach($images as $img): ?>
<div class="swiper-slide"><img src="<?= $img->url() ?>">
<span class="caption"><?= $img->caption() ?></span></div>
<?php endforeach ?>
<?php endif ?>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination swiper-pagination-white"></div>
<!-- Add Arrows -->
<div class="swiper-button-next swiper-button-white"></div>
<div class="swiper-button-prev swiper-button-white"></div>
</div>
Lastly, this is the โmodelsโ
<?php
class PostPage extends Page
{
public function cover()
{
return $this->content()->get('cover')->toFile() ?? $this->image();
}
public function coverone()
{
return $this->content()->get('coverone')->toFile() ?? $this->image();
}
public function covertwo()
{
return $this->content()->get('covertwo')->toFile() ?? $this->image();
}
public function coverthree()
{
return $this->content()->get('coverthree')->toFile() ?? $this->image();
}
public function coverfour()
{
return $this->content()->get('coverfour')->toFile() ?? $this->image();
}
public function coverpiece()
{
return $this->content()->get('coverpiece')->toFile() ?? $this->image();
}
public function coverpdf()
{
return $this->content()->get('coverpdf')->toFile() ?? $this->image();
}
public function mainslides()
{
return $this->content()->get('mainslides')->toFile() ?? $this->image();
}
public function subslides()
{
return $this->content()->get('subslides')->toFile() ?? $this->image();
}
public function subpieces()
{
return $this->content()->get('subslides')->toFile() ?? $this->image();
}
public function rightimage()
{
return $this->content()->get('rightimage')->toFile() ?? $this->image();
}
}
https://sommm.kr/projects
There is no problem with the thumbnail image for the list and the cover image at the top of the article.
Can anyone help me?