Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-08 08:50:48

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Hide tabs from admin navigation

Hi, i am (more or less) fooling around with admin side plugins (and writing them) and wonder, if there is any easy way to hide (but not remove) single tabs from admin side navigation. I can’t seem to be able to target the files tab, for instance.
CSS is not working, as tabs don#t seem to have unique #ids.
Any insights are greatly appreciated.

Last edited by jayrope (2011-06-08 08:53:25)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#2 2011-06-08 09:23:29

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Hide tabs from admin navigation

Sorry to answer my own question, but smd_tabber v0.11 really does very good already.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#3 2011-06-08 09:24:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,945
Website GitHub

Re: Hide tabs from admin navigation

jayrope wrote:

I can’t seem to be able to target the files tab, for instance.

You’re right; not easy. Best way I can think of is with jQuery. If you’re using a Remora-style theme, you could try this approach in a suitable <script> block (there’s a nice document.ready block at the top of Remora already that you could hijack in the html_head() function) :

$("#nav li a[href='?event=file']").parent().hide();

Someone else can no doubt improve on this solution but in the meantime I hope it helps.

EDIT: or create a new tab with smd_tabber as you found :-)

Last edited by Bloke (2011-06-08 09:24:39)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2011-06-08 11:06:33

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Hide tabs from admin navigation

Thanx Stef, smd_tabber is a blast, actually.
Thanx for the jquery suggestion.
I wasn’t deriving my theme from Remora, so instead i managed to apply an individual css #id to any of the tabs’ tds by referencing the name of the event they link to.
So now i just go display:none; by td id in the top navigation.
Sweet :)
Thanx for discussion in any case!

Last edited by jayrope (2011-06-08 11:07:30)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#5 2011-06-08 11:13:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,945
Website GitHub

Re: Hide tabs from admin navigation

jayrope wrote:

Thanx Stef, smd_tabber is a blast, actually.

Good show.

i managed to apply an individual css #id to any of the tabs’ tds by referencing the name of the event they link to.

We should probably do something like that in the core one day.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2011-06-08 11:48:54

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Hide tabs from admin navigation

I would support this, of course. I would even supply the patch (or actually the alteration of the theme.php) to the developers list, but have no idea about your (CSS ID) naming conventions. Now i simply used id="css-[event]"


A hole turned upside down is a dome, when there’s also gravity.

Offline

#7 2011-06-08 12:32:39

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

Re: Hide tabs from admin navigation

I use bot_privs to hide single tabs and sub-tabs.

Offline

Board footer

Powered by FluxBB