Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Integration Project For vbAdvanced and Logican's WebTemplates
TigerWare
Join Date: Feb 2007
Posts: 282

 

England, UK
Show Printable Version Email this Page Subscription
TigerWare TigerWare is offline 09-10-2007, 10:00 PM

Integration Project For vbAdvanced and Logican's WebTemplates

Pre-requisites!

This is the system on which the article was written, I have no idea whether it will work on earlier versions of vBulletin.
  • vBulletin 3.6.8
  • vbAdvanced CMPS 3.0 RC1
  • Logican's WebTemplate CMS 3.6.02

Introduction

What follows is a very simplistic solution to a problem that may face others. I use vbAdvanced CMPS for my main website page, and Logican's WebTemplate CMS for all other static pages. I prefer this because the LWT provides for me a much better platform for the creation of extra pages.

My problem was this. I wanted to share a standard side navigation solution across both products. I am a C# Applications Developer by trade, and I am totally into GUI design. Having identical look and feel across disperate systems is vital for me, and code reuse is also highly important. Anyway, enough with the lecture on geekdom. Simply, I wanted a menu system in both areas to enhance the user experience so they can't see the joins.

So, how to accomplish? I tried different things but could not get the content of a menu system to display in both systems. In the end I went ahead and created an external .js file to solve the issue. It did work, but it was a very rubbish solution. Time to read.

I found a very good article by Kerry-Anne concerning the creation of a simple template, and how to use the plugin system to actually be able to consume the output elsewhere. [How To Include A Custom Template Via Plugins]. This was the turning point of my 3rd day trying to solve this problem. So, big thanks to Kerry-Anne who is now officially my hero.

After a good deal of fumbling, testing, fiddling and hair pulling I discovered that to make this work in a good way, I had to create a template for my own raw HTML content, another template specifically for the vBa specification, which contains a little extra HTML and consumes the content of my first template. Both templates use 2 plugins each, and we are displaying content successfully from a single source accross 2 different products... bonzer!

What we end up with is a solution that has no database changes, no additional files to upload and no code changes. Of course, changes to what is being displayed (in my case a menu) is edited in the template itself; one location, dead simple!

Step By Step

1. Create Template for Logican's WebTemplate

AdminCP >> Styles & Templates >> Style Manager >> Add New Template
Quote:
Title: sitemenu
Template:
HTML Code:
<b>Raw HTML Content!</b>
2. Create 2 Plugins for "sitemenu" Template

AdminCP >> Plugins & Products >> Add New Plugin
Quote:
##Plugin 1##
Product: vBulletin
Hook Location: global_start
Title: Sitemenu LWT - Start
Execution Order: 5 (default)
Plugin PHP Code:
PHP Code:
eval('$sitemenu_plugin = "' fetch_template('sitemenu') . '";'); 
Plugin Is Active: Yes
Quote:
##Plugin 2##
Product: vBulletin
Hook Location: cache_templates
Title: Sitemenu LWT - Cache
Execution Order: 5 (default)
Plugin PHP Code:
PHP Code:
$globaltemplates[]='sitemenu'
Plugin Is Active: Yes
3. Displaying Output In Logican's WebTemplate Theme

AdminCP >> Logician's WebTemplates >> WebTemplates >> Edit Theme

It is already assumed that you have an appropriate theme. To display the output from the template created in steps 1 and 2 you would simply type in the variable name at the appropriate place.

HTML Code:
$sitemenu_plugin
4. Create Template for vbAdvanced

We have to create a seperate template for 2 reasons. First, to consume the template in vBa, the title must be prefixed with "adv_portal_" and secondly, the actual template contains some required additional HTML to make it display correctly inside the module (once we create it). As you can see, the variable name we used here is the same one that was displayed directly in LWT, so now we have a template inside a template.

AdminCP >> Styles & Templates >> Style Manager >> Add New Template
Quote:
Title: adv_portal_sitemenu
Template:
HTML Code:
<tr>
<td class="$bgclass">
$sitemenu_plugin
</td>
</tr>
5. Create 2 Plugins for "adv_portal_sitemenu" Template

AdminCP >> Plugins & Products >> Add New Plugin
Quote:
##Plugin 1##
Product: vBulletin
Hook Location: global_start
Title: Sitemenu vBa - Start
Execution Order: 5 (default)
Plugin PHP Code:
PHP Code:
eval('$sitemenu_adv_plugin = "' fetch_template('adv_portal_sitemenu') . '";'); 
Plugin Is Active: Yes
Quote:
##Plugin 2##
Product: vBulletin
Hook Location: cache_templates
Title: Sitemenu vBa - Cache
Execution Order: 5 (default)
Plugin PHP Code:
PHP Code:
$globaltemplates[]='adv_portal_sitemenu'
Plugin Is Active: Yes
6. Displaying Output in vbAdvanced CMPS

AdminCP >> vBa CMPS >> Add Module
Quote:
Module Type: Template
Name: Whatever
Active: Yes
Template to Include: adv_portal_sitemenu (prefix not required)
Now you can add the newly created module to the required location on your CMPS Page, and viola! You are displaying the same content as we have already seen.

Summary

Your final step would be to hone the HTML in your LWT Theme to mirror that of your vBa theme, and in my case the positioning of the output from both products has to be pixel perfect, which it is... but that is a whole different article!

At the time of writing I do not have a publically accessible site* to allow a demo of this integration, but I have attached an image to show what the output looks like in both product pages. The area inside the red rectangle is the bit being producted by this technique. On the left is the vBa page and on the right is the LWT page.

I am no vBulletin expert, and I'm pretty sure that there will be other ways to accomplish the same task, but for me this is a solution I'm very proud to have cracked. If this technique is of any use to others, then I'm happy that I have been able to give just a little back, with my thanks to the extended communities that make vBulletin A#1!

Cheers!

Respectfully Submitted,
TigerWare
Attached Images
File Type: png vBa_LWT_Integration.png (56.9 KB, 0 views)
Reply With Quote
  #2  
Old 09-14-2007, 06:23 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great tips, thanks for sharing!
Reply With Quote
  #3  
Old 12-16-2007, 09:27 PM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent read. I will definitely spend some time to study this in more detail.

Thanks
Reply With Quote
  #4  
Old 12-22-2008, 08:32 PM
john h john h is offline
 
Join Date: Dec 2008
Location: Australia
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to get this set up and I've followed the instructions but can't get the content from the template created in step 1 to display in vbAdvanced CMPS.

The content displays in the LWT page but not in vbA.

My Forum is vBulletin v3.6.2, vBadvanced CMPS v3.1.0 & Logician's WebTemplates 3.6.03
Attached Images
File Type: jpg vba.JPG (7.5 KB, 0 views)
File Type: jpg lwt.JPG (9.6 KB, 0 views)
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 06:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03886 seconds
  • Memory Usage 2,269KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_html
  • (4)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete