Try our conversational search powered by Generative AI!

Per Nergård
Feb 2, 2016
  3833
(5 votes)

Order tabs with drag and drop

To get that smoth editorial experience in edit mode a correct ordering of the tabs play an important part.

In most projects I tend to do a last minute check and change ordering and access rights. Unfortunately the Edit Tabs view in admin mode is a pain to use since you need to click edit on each row in order to change index number and access rights. 

As a remedy Episerver has given us the [GroupDefintion] attribute which lets us declare tabs and set access rights from code. Be aware that when using the [GroupDefinition] attribute all editing of tabs in admin mode is locked down, forcing you to do a code change, recompile ,deploy just to do a small tab change. Not good in my opinion.

So what to do.. Drag and drop tab ordering plugin to the rescue.

It's a simple admin mode plugin that lets you drag and drop order of tabs and change accesslevels without needing to click edit first. Just order the tabs and change access rights and hit save and youre done. 

You can change sort order of tabs defined by code but for some reason you cant change access rights. I always start the sortindex value counter at 100 and use a step of 100. For some reasons the numbers on tabs defined in code doesn't show the correct number but the new values are there.

To handle the drag and drop support I have used the excellent and very simple to use Dragula.js.

You can get the code over at my Gist

Image tabrreorder.png

Feb 02, 2016

Comments

Feb 3, 2016 11:50 AM

Nice work! I like

Arild Henrichsen
Arild Henrichsen Feb 4, 2016 12:59 PM

Nice! I like that Dragula works on touch devices too. 

A quick question: I know that manual reordering of properties on content types via the admin UI overrides ordering from code. (until CMS 7 it was the other way around).
Is it the same with ordering of tabs and categories now? (manual overrides code)

Obviously, if code always overrides manual changes, you would mess up any settings the editor made each time you deploy. But if everything is stored in the db now and persisted through deploys, that is great for keeping sites consistent between deploys and environments.

Please login to comment.
Latest blogs
From Procrastination to Proficiency: Navigating Your Journey to Web Experimentation Certification

Hey there, Optimizely enthusiasts!   Join me in celebrating a milestone – I'm officially a certified web experimentation expert! It's an exhilarati...

Silvio Pacitto | May 17, 2024

GPT-4o Now Available for Optimizely via the AI-Assistant plugin!

I am excited to announce that GPT-4o is now available for Optimizely users through the Epicweb AI-Assistant integration. This means you can leverag...

Luc Gosso (MVP) | May 17, 2024 | Syndicated blog

The downside of being too fast

Today when I was tracking down some changes, I came across this commit comment Who wrote this? Me, almost 5 years ago. I did have a chuckle in my...

Quan Mai | May 17, 2024 | Syndicated blog

Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024

The Experimentation Process

This blog is part of the series -   Unlocking the Power of Experimentation: A Marketer's Insight. Welcome back, to another insightful journey into...

Holly Quilter | May 16, 2024

Azure AI Language – Sentiment Analysis in Optimizely CMS

In the following article, I showcase how sentiment analysis, which is part of the Azure AI Language service, can be used to detect the sentiment of...

Anil Patel | May 15, 2024 | Syndicated blog