Log in

View Full Version : Creating Template Categories?


Reven
05-27-2006, 11:13 PM
I've searched a bit, but I've not found anything to do with this, as I don't exactly know what keywords to look for.

How do I go about grouping custom templates together within a template 'category'? So for instance currently in the Style Manager for any style we get 'Forum Home Templates', and within this we get various templates to do with the forum home. How would I group templates together under a name such as the example - 'Forum Home Templates'?

e.g.

Before expaning:

Custom Templates >>

After expanding:

Custom Templates <<
---- Custom Template 1
---- Custom Template 2
---- Custom Template 3

I've seen it done with v3arcade and vBadvanced CMPS, but I can't find a way of doing it...

Cheers.

Adrian Schneider
05-27-2006, 11:17 PM
I don't understand...

Grouping them? or having it more recursive?

Rich
05-27-2006, 11:19 PM
I think he wants to group his custom templates.

Adrian Schneider
05-27-2006, 11:19 PM
Anyway, if you just want to group some custom templates, create a plugin using the template_groups hook...// for adding one group:
$only['your_prefix'] = 'Your Group Title';

// For Multiple Groups
$only = array_merge($only, array(
'prefix_A' => 'Title A',
'prefix_B' => 'Title B'
));Note that it automatically adds "Templates" onto the end of your title.

Reven
05-29-2006, 02:31 PM
Is there something I need to do to get it to work, simialr to rebuilding the bitfields after adding ACP sidebar links, or should it work instantly?

peterska2
05-29-2006, 02:56 PM
It should work next time you open your style manager.

Reven
05-31-2006, 07:41 PM
Ah, turns out that if you have an underslash at the end of the array level like so:

$only['your_prefix_'] = 'Your Group Title';

It doesn't work. I guess that's logical.

Thanks, guys.