October CMS - Make different tab the default tab when editing a page?

- 1 answer

Ad

Is there any way to do this?

For instance, when editing a page the default tab is 'Settings'.

I have some new tabs assigned to the page, and I'd like to have one of these tabs the open tab by default. This is simply so the user doesn't see the code in the Settings tab and cannot interfere with it.

Any advice greatly appreciated.

Ad

Answer

Ad

All you need to do is to handle it with a javascript or jQuery code.

Make a new field in your model and its type should be partial and locate the file anywhere within your plugin.

For example: $/mynamespace/plugin/partials/my_js.htm

And in your partial write a javascript or jQuery code which removes class='active' from the default tab li and move it the one you want to be the default.

Ad
source: stackoverflow.com
Ad