Skip to content

Is it possible to use Slideouts just as an informative view, without save actions? #15198

Closed Answered by brandonkelly
gopeter asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can create a slideout manually via JavaScript, and put whatever you want in them:

const mySlideout = new Craft.Slideout('<p>Hello</p>');

For example, field layout designers will create slideouts for showing field layout element settings:

async createSlideout(data, js) {
const $body = $('<div/>', {class: 'fld-element-settings-body'});
$('<div/>', {class: 'fields', html: data.settingsHtml}).appendTo($body);
const $footer = $('<div/>', {class: 'fld-element-settings-footer'});
$('<div/>', {class: 'flex-grow'}).appendTo($footer);
const $cancelBtn = Craft.ui
.create…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gopeter
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants