Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 20 Dec 2008, 16:24
Sothside40's Avatar
Sothside40 Sothside40 is offline
 
Join Date: Feb 2008
Including templates in VBulletin

Hey, I'm currently trying to write a mod (my first) for vBulletin, and from the mods I've read it seems like they've been able to include their templates inside of other templates such as:

<template name="myTemplate" etc="" etc="">
<div>This is what the first template is</div>
</template>
Then from there I go into the style editor, and inside of the footer template I throw in: $myTemplate. The desired result is for the template I defined as "myTemplate" to be shown inside of the footer. Am I mistaken on the functionality of this? And if so, can you please tell me what I've done wrong?
Reply With Quote
  #2  
Old 20 Dec 2008, 17:40
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You need to eval a template before it can be used. Look in any of the php pages and you will see templates evaled:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 20 Dec 2008, 22:25
Sothside40's Avatar
Sothside40 Sothside40 is offline
 
Join Date: Feb 2008
fetch_template() seems to be returning null, no matter what template I use it on.
Reply With Quote
  #4  
Old 20 Dec 2008, 23:14
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Well, you probably need to include it in the global templates first.

You should take a look at these articles - How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 22 Dec 2008, 02:49
Sothside40's Avatar
Sothside40 Sothside40 is offline
 
Join Date: Feb 2008
I've read those articles, and I can't even get the examples working. fetch_template() is still returning absolutely nothing, even with templates that already exist (footer, navbar, etc).


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Result is a blank page, when it should be displaying a table. (that I have defined and am 100% positive exists in my boards templates)

Last edited by Sothside40; 22 Dec 2008 at 02:54.
Reply With Quote
  #6  
Old 22 Dec 2008, 04:59
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Post your full php page and your full template. That way we can see what you are doing wrong.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #7  
Old 22 Dec 2008, 11:12
Sothside40's Avatar
Sothside40 Sothside40 is offline
 
Join Date: Feb 2008
Template: test
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

PHP: plugin hooked to cache_templates
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That's all there is to it.

Last edited by Sothside40; 22 Dec 2008 at 11:18.
Reply With Quote
  #8  
Old 22 Dec 2008, 11:47
Adam21 Adam21 is offline
 
Join Date: Apr 2005
Whats your full php page?Is this page gonna be a link in your navbar or?
Reply With Quote
  #9  
Old 22 Dec 2008, 17:07
Sothside40's Avatar
Sothside40 Sothside40 is offline
 
Join Date: Feb 2008
I'm gathering the boards last.fm group statistics via the API (which are received with no problem) formatting them into HTML, and then placing them on the forum.

This will add a table(for content) between the main boards and navbar. I know currently my example would merely output just a table, but that's easily remedied once I can get my issues resolved.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:20.

Layout Options | Width: Wide Color: