Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 15

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Templates > Template Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 07.04.2004, 03:45   #1 (permalink)
Junior Mamber
 
richardt's Avatar
 
Join Date: Apr 2004
Location: Melbourne, Australia
Posts: 42
richardt is on a distinguished road
Send a message via MSN to richardt
Lightbulb Different frontpage template

Hey all,

Love the new forums! I've brought my sleeping bag so I can stay-over and play for the night.

Can anyone suggest a way to display a different template on the frontpage of a site? I'm sure there's a fairly simple hack I can use, but if you have any ideas please let me know!

Cheers!
__________________
Richard Thornton
http://richardthornton.com
richardt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 07.04.2004, 03:53   #2 (permalink)
Expert Mamber
 
mamboguy.com's Avatar
 
Join Date: Apr 2004
Location: Byron Bay, Australia
Posts: 253
mamboguy.com is on a distinguished road
Default Re: Different frontpage template

Please be more specific.
Mambo allows you to choose what template you use, and you can even make your own...
__________________
Brad Baker
Multiple Domain & Reseller Hosting
www.rochen.com
www.joomlatutorials.com
mamboguy.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07.04.2004, 04:44   #3 (permalink)
Baby Mamber
 
tafkar's Avatar
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 11
tafkar is on a distinguished road
Default Re: Different frontpage template

This might help you out.

http://forum.mamboserver.com/viewtop...erent+template

tafkar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07.04.2004, 07:58   #4 (permalink)
Senior Mamber
 
MamboHut's Avatar
 
Join Date: Mar 2004
Location: New Jersey, USA
Posts: 143
MamboHut is on a distinguished road
Default Re: Different frontpage template

if you looking for a random image in the header for each page , you can use newsflash module to add your images from the admin backend and publish it in the top module position for example and move the top position in your index.php file to the template header.
MamboHut is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07.04.2004, 08:42   #5 (permalink)
Junior Mamber
 
richardt's Avatar
 
Join Date: Apr 2004
Location: Melbourne, Australia
Posts: 42
richardt is on a distinguished road
Send a message via MSN to richardt
Default Re: Different frontpage template

Brad,

Thanks for that. I have been making components/modules/templates for a while now and have a number of clients running intranets and websites with Mambo. One client has asked for a specific template to be displayed on the frontpage ONLY, with the rest of the site using another template.

I'm trying to achieve this without changing too much in the core... My idea is to have one specific template published, but a switch (similar to tafkar's suggestion) will determine whether we are on the frontpage or not and then display another template for that page only.

I'll try what has been suggested but feel free to pass on any other ideas

Thanks!
__________________
Richard Thornton
http://richardthornton.com
richardt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08.04.2004, 00:40   #6 (permalink)
Junior Mamber
 
richardt's Avatar
 
Join Date: Apr 2004
Location: Melbourne, Australia
Posts: 42
richardt is on a distinguished road
Send a message via MSN to richardt
Thumbs up Re: Different frontpage template

Righto, I've found what I needed to do. If anyone else wants to achieve this, do as follows:

Open up your index.php and ind the following line (around 130ish):

Code:
$cur_template = $mainframe->getTemplate();
And replace with this (I've included the same line but commented out):

Code:
//$cur_template = $mainframe->getTemplate();
if  ($option == "com_frontpage"){  
	$cur_template = "TEMPLATE_NAME"; 
} else { 
	$cur_template = $mainframe->getTemplate();
}
This code determines whether the user is viewing the frontpage or not, and the displays a different template for that page only...

Let me know if you need a hand getting this to work
__________________
Richard Thornton
http://richardthornton.com
richardt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08.04.2004, 00:43   #7 (permalink)
Expert Mamber
 
mamboguy.com's Avatar
 
Join Date: Apr 2004
Location: Byron Bay, Australia
Posts: 253
mamboguy.com is on a distinguished road
Default Re: Different frontpage template

Nice work

See what the community can.... pffftt one person came up with....

__________________
Brad Baker
Multiple Domain & Reseller Hosting
www.rochen.com
www.joomlatutorials.com
mamboguy.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08.04.2004, 11:07   #8 (permalink)
Baby Mamber
 
Join Date: Apr 2004
Posts: 18
lewisteo is on a distinguished road
Default Re: Different frontpage template

Nice but may I ask... what if I have a series of contents within a menu... can I set to display different template based on the content they clicked...

Or maybe based on the different component they click too....

Thanks in advance...
lewisteo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12.04.2004, 21:40   #9 (permalink)
Mamber
 
lazarus_bitmap's Avatar
 
Join Date: Apr 2004
Location: Dallas, TX
Posts: 71
lazarus_bitmap is on a distinguished road
Send a message via MSN to lazarus_bitmap
Default Re: Different frontpage template

You can do it with a more enhanced version of the same switch statement. This thread on the official forum has some good examples of the code:

http://forum.mamboserver.com/viewtopic.php?t=11091

You can see this type of approach working on a client site I developed here:

http://rosencom.com

You'll notice that different templates (although the main difference is in the header) is used on each page.

Cheers,
__________________
Jerry Stevenson
----------------
Stevenson Consulting
lazarus_bitmap is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12.04.2004, 21:46   #10 (permalink)
Mamber
 
lazarus_bitmap's Avatar
 
Join Date: Apr 2004
Location: Dallas, TX
Posts: 71
lazarus_bitmap is on a distinguished road
Send a message via MSN to lazarus_bitmap
Default Re: Different frontpage template

This is my index.php / switch code, for those curious. It calls all the necessary templates for main page / sub pages. Notice that it's important to have defaults for pages that don't fit any of the arguments. Might not be an issue in the beginning, but if you have users creating new sections, it can create errors later if you don't use them.

Code:
<?php
defined( '_VALID_MOS' ) or die( 'Oops... Sorry, wrong page.' );

switch ($option) {
   case 'com_frontpage': //show home page template
     include_once ('index_home.php');
     break;
      
   case 'content':
        switch ($Itemid) {
        
        case '40': //think tank
          include_once ('index_thinktank.php');
         break;   
        
        case '42': //articles
           include_once ('index_articles.php');
           break;           
           
         case '31': //business leaders
          include_once ('index_bizleaders.php');
         break;
         
        case '32': //communication experts
          include_once ('index_commexpert.php');
         break;         
       
        case '30': //contact us
          include_once ('index_contactus.php');
         break;
         
         case '26': //resources
          include_once ('index_resources.php');
         break;
         
        case '29': //success stories
          include_once ('index_successstories.php');
         break;
         
        case '28': //who we are
          include_once ('index_whoweare.php');
         break;
        case '35': //privacy legal notices
           include_once ('index_home.php');
        break;    
        default:  // DEFAULT FOR ALL
          include_once ('index_articles.php');
          break;        
          }  // END: case 'itemid'
     
      break;  // END : case 'content'
      
   default:  // DEFAULT FOR ALL
      include_once ('index_home.php');
      break;    
}    
?>
__________________
Jerry Stevenson
----------------
Stevenson Consulting
lazarus_bitmap is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Template modules TheGreek Template Discussions 10 08.04.2004 00:27


All times are GMT +2. The time now is 10:06.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.