vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Feedback & Suggestions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2007, 06:52 AM
jw0ollard jw0ollard is offline
Senior Member
 
Join Date: Jan 2007
Posts: 139
Default Alt. Portal Template (ala Alt. Module Wrapper Template)

Is this doable?

I know I could:
  1. Create several new locations ($home[toprightblocks], $home[topleftblocks], etc)
  2. Add a Child Style(s) to my current style.
  3. Modify the adv_portal template in the child style(s).
  4. Move the blocks to the new positions on the pages I want.
  5. Change each page to use the new Child Style(s)
Or I could just:
  1. Copy the adv_portal template, call it adv_portal_alt
  2. Change its layout, and just keep the right, center, left positions (but the new template will change where they actually go)
  3. Associate the new Alt. Portal Template on the pages I want, in the exact same manner we can change to an Alternative Module Wrapper.
I know you can change what column a module is in per page, but this isn't what I'm talking about.. I mean if you want entirely different layouts on certain vBa pages without having to use several child styles.
Reply With Quote
  #2  
Old 11-02-2007, 11:03 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Alt. Portal Template (ala Alt. Module Wrapper Template)

The best way to do this would probably be to hack the files to allow different templates to be called. So, the first step would be to create your alternate templates. Then open up your inlcudes/vba_cmps_include_template.php file and add your new template names to the $globaltemplates array there.
Then you could add a new plugin to the 'vba_cmps_print_output' hook location with code that looks something like this:

Code:
switch ($pages['name'])
{
	case 'page1':
		$vbulletin->templatecache['adv_portal'] = $vbulletin->templatecache['adv_portal_alt1'];
	break;
	
	case 'page2':
		$vbulletin->templatecache['adv_portal'] = $vbulletin->templatecache['adv_portal_alt2'];
	break;

	case 'page3':
		$vbulletin->templatecache['adv_portal'] = $vbulletin->templatecache['adv_portal_alt3'];
	break;
	
}
Replace the red parts there with the different page identifiers that you want to use a different tempalte for, and the corresponding blue code with the tempalte name you would like to use.
Reply With Quote
  #3  
Old 11-02-2007, 12:10 PM
jw0ollard jw0ollard is offline
Senior Member
 
Join Date: Jan 2007
Posts: 139
Default Re: Alt. Portal Template (ala Alt. Module Wrapper Template)

That sounds like a good enough option.. other than the file edit part.

Performance-wise, do you think this case/break plugin would perform better than forcing multiple child styles on different vBa pages?
Reply With Quote
  #4  
Old 11-02-2007, 03:14 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Alt. Portal Template (ala Alt. Module Wrapper Template)

Case statements are very effecient, so it probably would not make much difference either way performance wise. I would think the case statement would be a little less cumbersome in some ways though since you wouldn't need multiple styles just to change one template. Although, if you're going to have more than a few different templates, the child style method might be a little better since each different template will have to be loaded into memory otherwise.
Reply With Quote
  #5  
Old 04-21-2010, 01:32 PM
doriggidy doriggidy is offline
Junior Member
 
Join Date: Jun 2007
Posts: 20
Default

I know this is an old thread, but it describes exactly what i need to do. I need my homepage to have a different adv_portal template than the restof my site. Is the hack the files approach still the best way or has this been addressed in upgrades made since the original post?

I only need it for the homepage...i considered a if this script = adv_portal but wouldn't that affect the other pages that are using the default adv_portal? since identifier pages are run through the cmps_index?
Reply With Quote
  #6  
Old 04-22-2010, 11:19 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default

If you're just making some changes for one page then an <if> tag in your 'adv_portal' template would probably be the best way to go.
Code:
<if condition="$pages['name'] == 'home'">
Homepage code here
<else />
Other pages code here
</if>
__________________
Frequently Asked Questions
CMPS Users Manual

For vBadvanced software assistance, please use the support forums.
Unsolicted PMs, IMs, and email will not be responded to.
If you have a non-software related question or problem with your account, please submit a support ticket.
Reply With Quote
  #7  
Old 04-22-2010, 12:48 PM
doriggidy doriggidy is offline
Junior Member
 
Join Date: Jun 2007
Posts: 20
Default

Thanks for the reply Brian.
Would I be able to do a fetch for the alternate template with the if conditional or should i just put all of the alternate code right there in the adv_portal template?
Reply With Quote
  #8  
Old 04-22-2010, 01:07 PM
gamerxxx gamerxxx is offline
Junior Member
 
Join Date: Apr 2010
Posts: 3
Default

this is an excelent idea!!! should be implemented as soon as possible!!!
Reply With Quote
  #9  
Old 04-22-2010, 06:24 PM
doriggidy doriggidy is offline
Junior Member
 
Join Date: Jun 2007
Posts: 20
Default

Worked like a charm thanks
Reply With Quote
Reply


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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative Module Wrapper Template not working iDaemon Troubleshooting & Problems 14 10-27-2007 01:03 PM
Portal template all messed up dbirosel Troubleshooting & Problems 1 02-23-2007 08:59 AM
Problem With Portal Template Style zane99 Troubleshooting & Problems 5 04-03-2006 10:26 AM
New template module rages4calm Troubleshooting & Problems 1 01-15-2006 03:08 PM
Template screw up with portal ProXie Troubleshooting / "How do I..." Questions 2 08-31-2004 12:21 PM


All times are GMT -4. The time now is 11:49 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.