Bagaimana Cara Kustomisasi Layout Panel Mecha? #257
Replies: 6 comments 7 replies
-
Kalau mas pasang ekstensi Kurang lebih formatnya seperti ini: [
'type' => 'rows',
'lot' => [
'row-1' => [
'type' => 'row',
'lot' => [
'columns' => [
'type' => 'columns',
'lot' => [
'column-1' => [
'type' => 'column',
'size' => 4 / 12,
'content' => '<p>Kolom 1.</p>',
'stack' => 10
],
'column-2' => [
'type' => 'column',
'size' => 8 / 12,
'content' => '<p>Kolom 2.</p>',
'stack' => 20
]
]
]
],
'stack' => 10
],
'row-2' => [
'type' => 'row',
'lot' => [ /* … */ ],
'stack' => 20
],
'row-3' => [
'type' => 'row',
'lot' => [ /* … */ ],
'stack' => 30
]
]
] Komponen dimulai dari ┌─ rows ──────────────────────┐
│ ┌─ row ───────────────────┐ │
│ │ ┌─ columns ───────────┐ │ │
│ │ │ ┌─ column 4/12 ───┐ │ │ │
│ │ │ │ <p>Kolom 1.</p> │ │ │ │
│ │ │ └─────────────────┘ │ │ │
│ │ │ ┌─ column 8/12 ───┐ │ │ │
│ │ │ │ <p>Kolom 2.</p> │ │ │ │
│ │ │ └─────────────────┘ │ │ │
│ │ └─────────────────────┘ │ │
│ └─────────────────────────┘ │
│ ┌─ row ───────────────────┐ │
│ │ … │ │
│ └─────────────────────────┘ │
│ ┌─ row ───────────────────┐ │
│ │ … │ │
│ └─────────────────────────┘ │
│ ┌─ row ───────────────────┐ │
│ │ … │ │
│ └─────────────────────────┘ │
└─────────────────────────────┘ Bisa dilakukan pengetesan di bawah $_['lot']['rows'] = [
'type' => 'rows',
'lot' => [ /* … */ ],
'stack' => 20
]; Kalau hasilnya sudah terlihat dan sudah mantap, bagian $desk = $_['lot']['desk']['lot'];
$_['lot']['rows']['stack'] = 10;
$_['lot']['rows']['lot']['row-1']['lot']['columns']['lot']['column-1']['lot'] = [ /* … */ ];
$_['lot']['rows']['lot']['row-1']['lot']['columns']['lot']['column-2']['lot'] = $desk;
unset($_['lot']['rows']['lot']['row-1']['lot']['columns']['lot']['column-1']['content']);
unset($_['lot']['rows']['lot']['row-1']['lot']['columns']['lot']['column-2']['content']);
unset($_['lot']['desk']); |
Beta Was this translation helpful? Give feedback.
-
oke kang, ane coba dulu |
Beta Was this translation helpful? Give feedback.
-
harus pake ini juga ya kang biar jalan Hook::set('_', function ($_) {
.....
return $_;
}); |
Beta Was this translation helpful? Give feedback.
-
Eh, mas ini nanti tak ganti jadi pembagian per-12 aja ya, bukan per-6. |
Beta Was this translation helpful? Give feedback.
-
Begini bisa, cuma memang masih ada bug di bagian flash message yang perlu Saya perbaiki dari sisi core: <?php
Hook::set('_', function ($_) {
$desk = $_['lot']['desk']; // Capture the desk area to insert later
$desk['size'] = 9 / 12;
$desk['type'] = 'column';
$_['lot']['rows'] = [
'gap' => false,
'lot' => [
'row-1' => [
'lot' => [
'columns' => [
'gap' => false,
'lot' => [
'column-1' => [
'decors' => [
'background' => 'var(--fill-bar)',
'color' => 'var(--color-bar)',
'min-height' => '100vh'
],
'lot' => [
'body' => [
'lot' => [
0 => [
'content' => '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>',
'level' => 3,
'title' => 'Lorem Ipsum',
'type' => 'content'
]
],
'type' => 'section'
]
],
'size' => 3 / 12,
'stack' => 10,
'type' => 'column'
],
'column-2' => $desk
],
'type' => 'columns'
]
],
'stack' => 10,
'type' => 'row'
]
],
'stack' => $_['lot']['desk']['stack'] ?? 10,
'type' => 'rows'
];
unset($_['lot']['desk']); // Remove the original desk area
return $_;
}, 1000); // Set the hook stack value as large as possible so that this hook will be executed last |
Beta Was this translation helpful? Give feedback.
-
Kalau mau buat halaman seperti .state itu gimana kang? |
Beta Was this translation helpful? Give feedback.
-
Bagaimana cara mengcustom Layout Panel Mecha? misal dari 1 side dijadikan 2 side
Beta Was this translation helpful? Give feedback.
All reactions