PDA

View Full Version : Templating Grouping/Enhanced Management


TWTCommish
03-02-2002, 10:00 PM
NOTE: This hack involves the modification of your template admin files. You may want to backup any files involved in this hack to guard against any major problems. Alright, on with the hack. :)

What's it do?
Ya know those template groups you see when you're modifying templates? The ones with titles like "Calendar templates" or "Forum Display templates" that reveal the templates they contain when you click on the "[expand]" link next to them? Well, this allows you to create, edit, and delete those easily through your admin CP. In addition, it allows you to switch ANY template from standard (like the way the default templates are displayed) to custom, or custom to standard...which means that you can have it placed as a "normal" template, and not under the "Custom template" heading.

I've attached an archive containing the files you'll need, and a text file containing the instructions. No screenshot is necessary, really, as I think the description tells you all you need to know.


Some Specifics
First off, if you add a new template group, and it doesn't show up, don't worry: that doesn't mean it isn't working. You need to create a standard, matching template before the group shows up. Here's a quick example (using a hack of mine called vBGlossary (https://vborg.vbsupport.ru/showthread.php?threadid=34385) very shamelessly. :D): Create a template called glossary_template
Specify it as a standard template by clicking "[make template standard]" on the Edit Template screen.
Notice that it's now among the "Default templates" that come standard with vBulletin.
Create a template group. Enter "glossary" in the "Group Text" field, and "vBGlossary" in the "Group Title" field.
Go back to your templates: now, near the bottom, you should see "vBGlossary [expand]" -- clicking on it will expand the group...in which you'll see the glossary_template template! Create any more standard templates beginning with "glossary" and they'll show up under the same group.
The ability to group as you please is nice, but in my opinion, the real value here lies in being able to make templates custom or standard, and then managing them with the groups. If you install a lot of hacks, you probably have a lot of custom templates. It's a big mess, in my opinion, to have them all stuffed together under one heading at the top. This hack lets you organize them easily with the rest of the "standard" vBulletin templates! I dunno if ya'll like it...but I love it. :D

One more quick example: vBulletin comes with 3 Avatar-related templates. I believe they are avatar. avatars, and avatarbit. Creating a template group called "Avatars" with a "Group Text" value of "avatar" will place these three templates in their own group. No switching is necessary, because they come standard with vBulletin...which means they're already standard templates. :)


Potential Cause For Confusion
It's not really a bug, because I think it's unavoidable: if you have a standard template, and you edit it, thus creating two templates (your current one, and the default template, which you can, of course, revert to or view as needed), switching it to standard will have BOTH templates show up under the custom heading...two, instead of one.

This hack has been tested by several others, but due to its specific nature, and the files and such involved, it is HIGHLY recommended that you backup the /admin/template.php file before proceeding with installation.

I hope this isn't too confusing. Enough talk: enjoy the hack!

Lesane
03-03-2002, 07:57 PM
Sounds very nice, i will install this one later. Nice job, thanks.

TWTCommish
03-03-2002, 07:58 PM
Gracias. :) Oh, by the way: a HUGE thanks to the people who were kind enough to beta test this hack for me. I really appreciate it! Your feedback has been invaluable.

afterlab
03-04-2002, 03:30 AM
Wow, nice hack! Installed it, and worked perfectly. Thanks for sharing.. :D

GameCrash
03-04-2002, 12:47 PM
Switching to standard will set templatesetid to -1? If so, what happens when I update my vB? The update routine kills every template with templatesetid=-1...

TWTCommish
03-04-2002, 12:57 PM
Well, I don't know how upgrade compatible it is; but why would an upgrade kill all those templates?

squawell
03-04-2002, 02:42 PM
this hack sounds great TWTCommish thankz ur work!

i will use this hack after my forum problem solved !!

GameCrash
03-04-2002, 02:46 PM
Upgrading vB does the following:

DELETE from template WHERE templatesetid=-1

and then all templates are inserted via INSERT INTO... that is why you can't edit templates with -1 directly via the CP - they would be lost.

TWTCommish
03-04-2002, 02:48 PM
Hmm, well, I haven't tested it for upgrade compatibility at all. When the next upgrade script is released I'd be glad to take a look and try to find a way around it, though, if it's plausible. Any thoughts/suggestions?

larryz
03-04-2002, 03:20 PM
Maybe mark them as -2 ??? Just an idea

I haven't installed this hack yet, but will soon. Very nice, beats using phpMyAdmin for default template editing.

Great Job!!

LawnDawg
03-05-2002, 02:03 AM
Oh good lord, tyvm Comm

Most useful hack ever so far.

My entire site uses vB's templating system :)

TWTCommish
03-05-2002, 02:08 AM
Yeah, that's one of the reasons I wrote it...I had a TON of custom templates lying around that needed organization badly...and I plan to build my next site all around vB's templating system. I'm glad you like it. :)

afterlab
03-30-2002, 05:01 PM
Hey is there a way to make it so that each template group has a display order, rather then showing them alphabetically? That'd be nice.

hypedave
04-07-2002, 07:07 PM
does anyone have a screen shot

TWTCommish
04-07-2002, 08:00 PM
It's not the sort of thing that lends itself well to a screenshot. The description explains it all perfectly. :)

hypedave
04-07-2002, 08:04 PM
hehehe ok, im gonna give it a shot, also I have like 4 themes on my board, im looking for a utility that if I make a change to one template it will update to the other tempates will this do the trick as well

TWTCommish
04-07-2002, 08:09 PM
No, this won't...as you'd know if you read the description. :D There is such a hack, however. A quick search should reveal it.

hypedave
04-07-2002, 08:10 PM
I know I know, I was jus hoping you would say you have something like in the making :)

Atian
04-10-2002, 08:27 PM
erm,all i get is a blank,i dont see anything >__<

Dark_Wizard
06-25-2002, 11:27 PM
Hmmm...it's not working now after php 4.2.1. Anyone else get this to work with the new php?

X-Fan
07-15-2002, 03:04 PM
Any suggestions as to how to get this working with NanoEntity's Template Mod hack, as that hack changed around a lot of the code this hack needs to edit.

Birdie501
07-15-2002, 03:22 PM
can this hack also group templates that end with a specific word?

Example: test_buddy
buddy_test2

is in one group? So it put all templates together which have buddy in its name?

X-Fan
07-15-2002, 03:48 PM
The Add category isn't working for me at all. Granted, it does add the category, but it doesn't put any templates matching the text into the category.

Case in point, the glossary templates. I created the vBGlossary category and set the Group Text to glossary, but the glossary templates are still at the top under Custom Templates.

Ditto for vBQuiz - created vBQuiz category with quiz as Group Text, but the quiz templates are still at the top.

Help!!!

Kars10
01-27-2003, 10:35 AM
This Hack is the bomb!!
Works like a charm on 2.2.9
Thank u so much TWT!! :)

* Kars10 klicks install!!

geniuscrew
02-12-2003, 08:28 AM
Works

But

You need to Create the "group", then the templates will group into their proper group.

Also any previous custom templates will need to be "switched" in order to be grouped - this IMHO is VERY time consuming, so how about something which let's you select the templates, then switch them all at once?

:D

Kohhal
02-12-2003, 12:17 PM
I'd like to install this hack but not if I'm going to lose my templates the next time I upgrade. Is there an answer to the upgrade issue yet?

Breaker
03-29-2003, 05:17 PM
well this decided 2 ungroup my templates :(setup all the categories but they not working very well

Breaker
03-29-2003, 05:30 PM
ignore fixed ;) need mass switch function or have it when u create template groups it takes templates from custom aswell

Dean C
03-29-2003, 05:51 PM
Yet another brilliant hack i missed before the beginning of time :)

- miSt