General developer forum

Change the order of buttons

 
Picture of Julia Rietveld
Change the order of buttons
 

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: -
Picture of Raad Al-Rawi
Re: Change the order of buttons
 

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

 
Average of ratings: -
Picture of Julia Rietveld
Re: Change the order of buttons
 

Thank you Raad!

 
Average of ratings: -