vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Create Template Group (https://vborg.vbsupport.ru/showthread.php?t=160269)

RobDog888 10-15-2007 02:00 AM

Create Template Group
 
<font color="darkgreen">How the heck do you create a template group? I searched the API docs and the site but nothing comes up.</font>

Princeton 10-15-2007 03:20 AM

in template_groups hook add..

$only['mytemplates'] = 'My Templates';

tips
* prepend all your template names with "mytemplates"
* save all templates in MASTER STYLE

RobDog888 10-15-2007 03:29 AM

But thats just it. I found this
https://vborg.vbsupport.ru/showthread.php?t=70165
which showed me that file to use and there is a hook there at the bottom

Code:

($hook = vBulletinHook::fetch_hook('template_groups')) ? eval($hook) : false;
So I figured I could make a plugin for it and just merge a few array items to the $only variable but there is no listing in the add new plugin for template_groups.

Im sure there is a way but after that would having it as a plugin create an issue as its not really physically in the table?

Thanks


--------------- Added [DATE]1192423255[/DATE] at [TIME]1192423255[/TIME] ---------------

Hmm, how about like this having the plugin use global_start.

Code:

eval('$template_hook[template_groups] .= "' . array_push($only, 'item6' =>  $vbphrase['item6']) . '";');
Im really trying to avoid manual file and template edits for my product.

Andrew Green 10-15-2007 03:47 AM

that article is a few years old, probably doesn't do it the same way.

You don't need any file edits, just name all your templates with the same prefix and create the plugin as Princeton said.

RobDog888 10-15-2007 03:53 AM

<font color="darkgreen">Yes, I didnt even notice that. Guess too many hours on the computer today lol.

What would be the hook to use for this plugin? global_start? or cache_templates or parse_tempaltes etc?

I did name a few of my templates already like that and placed them in the User Control Panel Templates group with naming them usercp_blah but I now have to move them into this new group once the plugin is completed and I assume that will break some of my code in the php pages too. Oh well I guess I can fix it later. </font>

Andrew Green 10-15-2007 03:56 AM

Quote:

Originally Posted by RobDog888 (Post 1360391)
Yes, I didnt even notice that. Guess too many hours on the computer today lol.

What would be the hook to use for this plugin? global_start? or cache_templates or parse_tempaltes etc?

I did name a few of my templates already like that and placed them in the User Control Panel Templates group with naming them usercp_blah but I now have to move them into this new group once the plugin is completed and I assume that will break some of my code in the php pages too. Oh well I guess I can fix it later.


hook location is: "template_groups" under General Administration

RobDog888 10-15-2007 04:02 AM

Son of a ... I have been looking throughout all the templates groups looking for it. Guess I passed through the admin stuff thinking it would be somewhere else.

Now I am not sure whats going on but it removed my vBAdvanced tempalte group and they are all at parent level with no new template group that I specified. Is my code ok?

Thanks :)


--------------- Added [DATE]1192425307[/DATE] at [TIME]1192425307[/TIME] ---------------

Code:

eval('$template_hook[template_groups] .= "' . array_push($only, 'testgroup' =>  'Test Group') . '";');
That is the code I am using to test with. i didnt create a phrase for it yet so I just wrote it in there.

--------------- Added [DATE]1192429143[/DATE] at [TIME]1192429143[/TIME] ---------------

I checked out vBA's hook to see how they do it and theirs is like this...

Code:

$only['adv_portal'] = $vbphrase['group_adv_cmps'];
So I figured I could use the same code...
Code:

$only['test'] = 'Test';
But nada still. I even changed the execution order as they were both on 5. I changed mine to 6 and still nothing. I disabled vBA and yet still nothing. :(


--------------- Added [DATE]1192431724[/DATE] at [TIME]1192431724[/TIME] ---------------

I got it working with the code that was similar to vBA but the template group never showed up until I modified one template that was eventually going to go into it. Guess the template group will not show unless there is at lease one template in it.

Since thats the case, I wonder how you are supossed to do it without modifying the template record?


All times are GMT. The time now is 02:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02061 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete