Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-15 16:43:09

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Change sub-tab ordering?

My jmd_dashboard tab, “Welcome,” is being displayed last under the “Content” tab. Is there a way I can move it to first place, all the way to the left?

Offline

#2 2011-03-15 16:57:44

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Change sub-tab ordering?

Can you edit the plugin code where it registers with “Content” and change it to “Home”?

Home is a new TL tab, but it only displays if there is something there. If jmd_dashboard is the only sub tab, it should display by default when you click on home. I think – in theory. I’ve not tried it out yet :)

Last edited by maverick (2011-03-15 16:58:09)

Offline

#3 2011-03-15 17:50:53

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: Change sub-tab ordering?

I tried changing it to “home” (assuming no caps since “content” didn’t have them) inside the jmd_dashboard plugin, but that didn’t do anything — except that “Welcome” no longer shows up under “Content.”

Would love to know how that “Home” tab can be drawn out of its cave!

Offline

#4 2011-03-15 18:12:23

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Change sub-tab ordering?

Does this help?

There was a discussion on what to call the new tab, and I think “home” was settled on, but it may be coded as start or start_tab. And you have to add privileges for it to show.

Last edited by maverick (2011-03-15 19:59:53)

Offline

#5 2011-03-15 19:05:41

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: Change sub-tab ordering?

Yes! That helps very much. Solved my problem. :-)

Here’s the beginning of the jmd_dashboard plugin code, with the changes:

if (txpinterface == 'admin')
{
    add_privs('jmd_dashboard', '1,2,3');
    add_privs('tab.start','1,2,3,4,5,6');
    register_tab('start', 'jmd_dashboard', 'Welcome');
    register_callback('jmd_dashboard', 'jmd_dashboard');
    ob_start('jmd_dashboard_tab');

Note that it will call your tab “Home” even though the code says “start.” Which is OK by me but just a bit unexpected.

Here is the result, caught in the wild (modified Air theme):

That poor lonely Welcome tab… :-)

Offline

#6 2011-03-15 19:08:51

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Change sub-tab ordering?

You should be able to get rid of the “Welcome” by changing one line:

register_tab('start', 'jmd_dashboard');

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#7 2011-03-15 19:12:17

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: Change sub-tab ordering?

Hm. That leaves an undefined variable error. I’d be interested to know how to remove the Welcome though.

Offline

#8 2011-03-15 19:53:35

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Change sub-tab ordering?

What if you keep the apostrophes but leave content blank?

register_tab(‘start’, ‘jmd_dashboard’, ‘’);

Offline

#9 2011-03-15 21:41:40

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: Change sub-tab ordering?

Looks like I get a narrow blank tab if I do that. :-)

Offline

#10 2011-03-16 13:40:48

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Change sub-tab ordering?

Are you using the Txp’s default theme?

When I tested it, the only thing that showed is the active tab indicator, which is set in the admin theme.

Offline

#11 2011-03-16 17:18:22

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 590
Website

Re: Change sub-tab ordering?

Ah, that’d be it then — I’m using Air, so I’ll have to take a look at that code. Thanks.

Offline

Board footer

Powered by FluxBB