Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-31 14:08:01

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

smd_tabber: create custom admin-side tab structures

Ever wanted to direct a client to a particular area on the admin side or collect useful functionality together in one place? You could choose a best-fit dashboard plugin… or use smd_tabber to roll your own menu system.

  • Install the plugin
  • Visit Admin->Manage tabs and create your tab hierarchy (or add new sub-tabs to the existing menu structure)
  • Create Page content / Stylesheets in TXP’s usual Page/Style tabs. Employ markup and TXP tags as if you were on your public site
  • Associate the Page and Stylesheet with the tab — you can reuse them across tabs if you like
  • Click the shiny new tab to see your content rendered on the admin-side

Simple as that. You can reorder your new tabs to suit your workflow and I’m sure with inventive uses of themes and privileges you can turn other parts on or off to please your clients.

The plugin also adds a couple of convenient shortcut tags to allow you to direct people to the Page/Stylesheet that is in use on the current tab. Wrap in appropriate rvm_privileged statements.

Take it for a spin and let me know what you think.

Revision history
————————

All available versions and changes are listed here. Each entry indexes the relevant post(s) in the thread to learn about the features.

26 Nov 2024 | 0.2.0 | Refactor code for a smaller global footprint; Fix table installation bug (thanks, jools-r; Plugin integrates with other privilege management plugins (such as smd_user_manager); CSS is injected using UI library (if available) to permit CSP rulesets.
31 Mar 2011 | 0.11 | Import $pretext to prevent warnings when using article tags (thanks redbot) ; improve documentation clarity
31 Mar 2011 | 0.10 | Initial public release

Last edited by Bloke (2011-03-31 19:20:30)


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

#2 2011-03-31 15:22:39

Ninja-Backflip
Member
From: England
Registered: 2011-02-22
Posts: 14

Re: smd_tabber: create custom admin-side tab structures

Awesome!!!

My “essential list of must have plug-ins” keeps getting bigger. And a huge chunk of them are prefixed smd_.

Cheers Mr Dawson, your efforts are very much appreciated!

Last edited by Ninja-Backflip (2011-03-31 15:29:51)

Offline

#3 2011-03-31 16:15:07

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

Re: smd_tabber: create custom admin-side tab structures

Wonderful job, Stef. Thanks for this release! This is running like a champ on one of my sites already — love that I can style those tabs however I want.

If you need a dashboard plugin, this is the one. Very flexible, like all things SMD.

I mean, all plugins SMD. :-P

Offline

#4 2011-03-31 16:35:17

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_tabber: create custom admin-side tab structures

Hi Bloke,
for sure I’m doing something stupid but I can’t understand what.
If I create a tab and in it’s page template I write: <txp:article_custom /> I get this error when accessing the tab:


Warning: extract() expects parameter 1 to be array, null given in C:\xampp\htdocs\txp3\textpattern\publish.php on line 599
Notice: Undefined variable: q in C:\xampp\htdocs\txp3\textpattern\publish.php on line 627
Notice: Undefined variable: q in C:\xampp\htdocs\txp3\textpattern\publish.php on line 662
Notice: Undefined variable: q in C:\xampp\htdocs\txp3\textpattern\publish.php on line 778
Notice: Undefined variable: q in C:\xampp\htdocs\txp3\textpattern\publish.php on line 817

Furthermore the “sort order” doesen’t work for me – it’s always the last tab.

P.S. yes, I’m using txp 4.4

P.P.S. If I use <txp:article /> I have similar errors – but more

Offline

#5 2011-03-31 16:46:33

Ninja-Backflip
Member
From: England
Registered: 2011-02-22
Posts: 14

Re: smd_tabber: create custom admin-side tab structures

I wonder if anyone can point me in the right direction….

A problem I find from a clients point of view, is effective frontpage management. Some of the sites i build have several static content blocks on the frontpage. Up till now, I just been creating a section called frontpage and using a combination of glz_custom_fields and bot_wtc to create a simple, intuitive write panel. Works pretty well, but I’d like a separate tab that allows the clients to modify the page content. Any tips on how I can do this with your plug-in?

Offline

#6 2011-03-31 16:56:39

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

Re: smd_tabber: create custom admin-side tab structures

Thanks for the props everyone. Been working on this about a month to get it right. Which means I’m kind of half-prepared for…

If I create a tab and in it’s page template I write: <txp:article_custom /> I get this error…

I have alluded to this kind of thing in the docs but it’s a tricky mistress. See, although your page is running through the parser it’s not really on the front of house so some ‘article-like’ tags will misbehave because their default values are read from stuff that TXP sets up in the public-side environment. Since we don’t have that environment, a lot of the defaults are not set and you have to manually set attributes you wouldn’t normally expect to have to set. So try adding some more attributes and see if things improve.

EDIT: Oh, hang on. That error pertains to the fact that $pretext doesn’t exist. We’ll have to find out how to get hold of it and put it in the page. I’ll have a play.

Furthermore the “sort order” doesen’t work for me – it’s always the last tab.

I think the docs touch on this too (somewhere!) The sort order is for items within a tab. Unfortunately top-level tabs will always appear after Extensions: that’s just because of the way TXP gets there first and draws its menus before my plugin gets a look-in. If you want to make something more prominent, put in on the ‘start’ area, or under one of the existing tabs.

Does that help a little?

Last edited by Bloke (2011-03-31 17:13:15)


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

#7 2011-03-31 17:14:31

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: smd_tabber: create custom admin-side tab structures

my doG! you just insist on giving loaded weapons to children, don’t you. Well…

Thanks for the bazooka uncle stef.

Offline

#8 2011-03-31 17:22:03

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

Re: smd_tabber: create custom admin-side tab structures

Bloke wrote:

That error pertains to the fact that $pretext doesn’t exist.

You can silence the errors by editing line 76 of the plugin (the top of the smd_tabber_render_tab function) by making the line read:

global $smd_tabber_callstack, $pretext;

Whether that actually fixes anything or not remains to be seen, but it at least shuts the errors up.


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

#9 2011-03-31 17:30:46

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

Re: smd_tabber: create custom admin-side tab structures

mrdale wrote:

Thanks for the bazooka uncle stef.

You’re welcome. The safety’s off…


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

#10 2011-03-31 17:47:05

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_tabber: create custom admin-side tab structures

Thanks for your answer Bloke. All in all this is not a problem since I was just trying some random tags, I really don’t need to use “txp:article_custom />”

Bloke wrote:

Unfortunately top-level tabs will always appear after Extensions…

Yes I read this on the plugin’s help, the thing is I don’t seem to be able to sort even secondary-level tabs.
Probably this is a problem of mine – and not a big one – I’ll report here if I find what I was doing wrong.

Apart from that this willl be very useful, thank you!

Edit Ok now I got it. Probably I misunderstood what you meant for “top-level tabs”. I thought you were talking about the ones on the top row while maybe you meant “all standard txp tabs”. In other words the sorting works ok only among newly created tabs. Not a big issue anyway.

Last edited by redbot (2011-03-31 18:13:44)

Offline

#11 2011-03-31 18:13:00

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_tabber: create custom admin-side tab structures

Bloke wrote:

You can silence the errors by editing line 76 of the plugin… Whether that actually fixes anything or not remains to be seen, but it at least shuts the errors up.

Thanks Bloke this does shut the errors up and fixes everything else. I suggest you adopt this change for the next release.

Offline

#12 2011-03-31 18:47:41

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

Re: smd_tabber: create custom admin-side tab structures

redbot wrote:

Probably I misunderstood what you meant for “top-level tabs”.

Ah yes, my silly naming convention. If anybody can think of a better name (primary/secondary maybe?) I’ll revisit the docs and make it clearer. Sorry about the misunderstanding.

In other words the sorting works ok only among newly created tabs. Not a big issue anyway.

Yes, if you imagine Remora, your “top level” tabs (actually “Areas” in TXP-speak) will appear in alphabetical order to the right of the Extensions tab. I couldn’t figure out a neat way to allow sorting by Area but I may in future add another sort order field below the area to allow you to do that.

The current sort order just governs the order of the items when you hover over your new area. The sort order is per area. All this should be in the docs really: I’ll address that when I issue the fix with:

… I suggest you adopt this change for the next release.

I’ll just wait a tiny bit longer to see if there’s any more fallout / bugs from other people or if importing that global causes any havoc elsewhere. I don’t think it’ll hurt anything, but I’ll do some testing to make sure first.


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

Board footer

Powered by FluxBB