vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Call a template within a template (https://vborg.vbsupport.ru/showthread.php?t=213421)

testbot 05-11-2009 04:51 PM

Call a template within a template
 
i would like to combine two mods. what's the easiest way to do this? i was thinking maybe i can call the one template from within the main mods template?

thanks for your help

RLShare 05-11-2009 05:05 PM

What mods are you talking about?

And you cannot call a template from within another template, but you can grab a template from within a plugin and store the data into a variable that you can display in another template. But if you are talking about combining two mods I doubt it will be as simple as that.

testbot 05-11-2009 05:08 PM

thanks for your quick reply.

i would like Latest Album Pictures (https://vborg.vbsupport.ru/showthrea...ighlight=album)

to display in All Albums (https://vborg.vbsupport.ru/showthread.php?t=172215)

:D

RLShare 05-11-2009 05:13 PM

You would have to modify the way both mods work in order to do it, if you are not a coder then you may find this difficult.

Basically you have to change the plugin that generates the latest albums and have it execute on the all albums page first. Then change it from making automatic template edits and have it store the data in a variable. And last you would have to modify a template from the all albums mod to add that variable in.

testbot 05-11-2009 05:28 PM

i was looking at the plugins but i didn't see an All Albums hook. i thought maybe i could make a new plugin based off of Latest Album and then make it use an All Albums hook or something.

idk, i might have to revisit this another time. i just don't have the time to research and make this happen right now i guess.

thanks again for your replies.

RLShare 05-11-2009 05:33 PM

There isn't an 'all albums' hook... The best way would be to change the hook location to 'global_start' or one of the global hooks, check the THIS_SCRIPT define and only allow the rest of the code to execute when THIS_SCRIPT is defined as what it is defined as in the all albums file. You would also have to modifify the 'Latest Album Picture' plugin that executes on the hook location 'cache_templates' and change the THIS_SCRIPT check against that value as well instead of 'index' as it does now.

RLShare 05-11-2009 06:06 PM

1 Attachment(s)
Here I just made some quick tests and here is a quick fix for the Album Pictures mod with changes to make it work on the all albums page...

You will need to edit the 'album_all_album_list' template and add '$pblatestalbums' to where you want the Album Pictures mod to display at. I have also attached a modified version of the 'all albums' product which has it showing right below the navbar if that is where you want it to display.

testbot 05-12-2009 02:26 AM

DUDE!!! THAT'S PERFECT!!!

you rock, bro! best thread and answer i've experienced in vbulletin :)

RLShare 05-12-2009 02:46 AM

lol.. your welcome


All times are GMT. The time now is 08:38 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.02258 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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