How to change Collection Types order in Content Manager
Salvador Sru
I need to modify the order of the side list of the collection types to maintain a better usability. As you can see in the example picture the "categories" and "subcategories" are too far apart... it seems to me something basic but I have not been able to find information or a plugin to solve my problem.
wtf
If anyone needs this, you can "hack" the submenu order with a bit of CSS. For this add the following in src/admin/app.js :
export default {
// ...
bootstrap(app) {
const customCSS = document.createElement('link') as HTMLLinkElement;
customCSS.rel = 'stylesheet';
customCSS.href = '/my-custom-styles.css';
document.head.append(customCSS);
},
};
create a file public/my-custom-styles.css :
nav[aria-label="Content"] ol {
display: flex;
flex-direction: column;
}
nav[aria-label="Content"] ol li:has(> a[href*="mycontenttype"]){
order: -2;
}
nav[aria-label="Content"] ol li:has(> a[href*="othercontenttype"]){
order: -1;
}