Version: 1.00, by Mutt
Developer Last Online: Mar 2013
Version: 2.2.x
Rating:
Released: 02-08-2002
Last Update: Never
Installs: 16
No support by the author.
I was getting my templates ready to upgrade to 2.2.2 and I came up with this idea. vbLinks set it's templates as part of the default set and needed to be changed over to custom templates.
the default templates are seperated into groups, but when you make a bunch of custom templates, wouldn't it be nice to have them be grouped as well? Anyway, it was really easy.
open template.php and scroll down to the "Start Modify" section
you'll see
$only['calendar'] = 'Calendar';
$only['emailsubject'] = 'Email Subject';
etc.
they are set up like this
$only['**begining of template title**'] = '**Group Title**';
name your template something like
links_firsttemplate
links_secondtempate
then with all the other $only[*] lines add
$only['links'] = 'vbLinks';
links is the begining of all the links templates and vbLinks is the title for the group of templates
maybe later I'll make a admin cp form to add the group titles but for now just add them to template.php
just making these changes would make the new groups show up under the default templates, but to make them appear in the custom section
find
PHP Code:
while ($template=$DB_site->fetch_array($templates)) {
if (!$donecustom) {
$donecustom=1;
echo "<b>Custom templates</b>";
}
if ($under) {
if ($lastunder!=$under and $lastunder and $shrink) {
echo "</ul></li>\n";
$shrink = 0;
}
$lastunder = $under;
if (!$shrink) {
echo "<li><a name=\"".urlencode($shortname)."\"><b></a>$under Templates <a href=\"template.php?s=$session[sessionhash]&action=modify&expandset=$templateset[templatesetid]&group=".urlencode($shortname)."#".urlencode($shortname)."\">[expand]</a></b>\n<ul>\n";
}
$shrink = 1;
if ($group!=$shortname and $group!="all") {
continue;
}
} else {
if ($shrink) {
echo "</ul></li>\n";
}
$shrink = 0;
}
(I just grabed this from the default template section)
thats it. now your custom template will be grouped as well.
whats real nice is say you added some custom templates that should be grouped with the default ones like new error message, postbit, or getinfo templates, they will not only get grouped with that group name under custom templates, but when you expand the default postbit templates, the custom postbit templates will be expanded as well.
If I missed something let me know.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by Jawelin Evil's Advocate question: does it work with FireFly's TBS hack ?
I make an extensive use of it and wouldn't create uncompatibilities...
Thnx
My hack is completely independent so you shouldn't worry.
I'm gonna install this hack myself soon (since I pretty much have more custom templates than default... I think ).
Originally posted by FireFly
My hack is completely independent so you shouldn't worry.
[...]
Oh, and I think it's Devil's advocate.
Of course...
MisTYPO!
Actually I didn't realize that groups are built only at displaying time... Though they where folders of templates...
Sorry for such a silly question
Thnx