Change the order of buttons

Change the order of buttons

by Julia Rietveld -
Number of replies: 2

Hallo clever people,

I wonder if I can change the order of submit and cancel buttons in Boost. For me the cancel button should be left and the submit button should be right because of my flow (from left to right). 

wrong button flow


Ik know that these buttons are generated in templates/core_form/element_template.mustache in this code block line 62 - 70

My question is how can tell Moodle to first inject the cancel button and then the Save-and-display?

Love, Julia
Average of ratings: -
In reply to Julia Rietveld

Re: Change the order of buttons

by Raad Al-Rawi -

Hi Julia


You can do this by tweaking the CSS:


#page-course-edit div[role="main"] form > div[data-groupname="buttonar"] div[data-fieldtype="group"] {
    display: flex;
}
#page-course-edit div[role="main"] form > div[data-groupname="buttonar"] div[data-fieldtype="group"] div.form-submit {
    order: 1;
}


This will specifically target the "Save and display" button on the "Edit course settings" page.

Hope that helps.


Raad

~~

Raad Al-Rawi

Moodle Technical Developer/DBA

University of Cambridge, UK