![]() |
|
#1
|
|||
|
|||
|
Is this doable?
I know I could:
|
|
#2
|
||||
|
||||
|
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;
}
|
|
#3
|
|||
|
|||
|
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? |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
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? |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
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? |
|
#8
|
|||
|
|||
|
this is an excelent idea!!! should be implemented as soon as possible!!!
|
|
#9
|
|||
|
|||
|
Worked like a charm thanks
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |