Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 Next > End >>
Assign Template to CB
Date: 2006/04/11 15:28 By: spikec Status: CB Doc subscriber  
Karma: 13  
Senior Joomlapolitan

Posts: 81
graphgraph
Has anyone figured out a hack that will allow assignment of a template to the entire CB component? I understand how joomla is menu driven, and you can only assign a template to a specific menu item...blah blah blah. Right now I can assign my desired template to the parts of CB that have a menu link, but when for example, you click on a members avatar (or any other part of the CB component that you can't tie to a menu item), it goes to the user's profile but reverts to the default template.

It seems to me a simple "if/else" condition in the joomla index.php (around line 195) might do he trick, as in :

if ( $option='com_comprofiler') $template='desired template';
else $cur_template = $mainframe->getTemplate();

I've tried this several different ways, but no workie, probably because my syntax is wrong. Seems to me that this would be an easy way to get around the whole assigning templates mess....
Any thoughts?

Post edited by: spikec, at: 2006/04/11 09:29
Click here to see the profile of this user The topic has been locked.

Re:Assign Template to CB
Date: 2006/05/11 16:08 By: TheAnt Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
Please, I need this too.
Help us!!
Click here to see the profile of this user The topic has been locked.

Re:Assign Template to CB
Date: 2006/05/20 01:09 By: rex339 Status: User  
Karma: 0  
Junior Joomlapolitan

Posts: 25
graphgraph
this looks interesting
Click here to see the profile of this user The topic has been locked.

Re:Assign Template to CB
Date: 2006/05/20 18:59 By: dave Status: CB Doc subscriber  
Karma: 3  
Junior Joomlapolitan

Posts: 33
graphgraph
I have had the following script in my index file for a long time - it works great.

In index.php, find the following:
Code:

 // loads template file if ( !file_exists'templates/'$cur_template .'/index.php' ) ) {     echo _TEMPLATE_WARN $cur_template;



Add Something like the following before the above code:

Code:

 //template hack if($option == 'com_comprofiler') { $cur_template 'template1';} elseif($option == 'com_content' && $task == 'blogcategory' && $id == '1' && $Itemid == '131') { $cur_template 'template2';}



That is it. You can get this to work at the componant level or even down to a specific page. You can have unlimited elsif statements - I have about 12.

Post edited by: dave, at: 2006/05/20 13:00
Click here to see the profile of this user The topic has been locked.

Re:Assign Template to CB
Date: 2006/05/20 21:13 By: spikec Status: CB Doc subscriber  
Karma: 13  
Senior Joomlapolitan

Posts: 81
graphgraph
That is awesome! I read over at joomla.org that assigning a template to a component could not be done. I had been using a workaround of using the desired CB template as the default template, and assigning the real default template to everything else. I appreciate you sharing this!
Click here to see the profile of this user The topic has been locked.

Re:Assign Template to CB
Date: 2006/07/20 07:55 By: renoa Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 1
graphgraph
omg it works!! thank you very much you have no idea how much i suffered from this
Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login