Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

This is an old revision of the document!


Create custom per page templates

Source: osCMax Docs - Thanks to michael_s

  • If you wanted to, each page on your site could have its own look, completely different from the others. There are several ways to do this, and I will explore each, but this seems to be the simplest way to do it.

Michael_s has put this together to demonstrate how to have a completely different main template for different pages of osCMax.

Step 1: Add new template definition

  • Edit /catalog/includes/configure_bts.php and add a new main template definition.

Under this on line 19:

define('TEMPLATENAME_MAIN_PAGE', 'main_page.tpl.php'); 
Add this:
define('TEMPLATENAME_MAIN_PAGE2', 'main_page2.tpl.php');

Next, after this block of code (lines 43-50):

    case 'main':
    // default or main_page
      if(is_file(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE)) {
          $path = (DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE);
      } else {
          $path = (DIR_WS_TEMPLATES_FALLBACK . TEMPLATENAME_MAIN_PAGE);
      }
    break;  

Add this:

   case 'main2':
    // default or main_page
      if(is_file(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE2)) {
          $path = (DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE2);
      } else {
          $path = (DIR_WS_TEMPLATES_FALLBACK . TEMPLATENAME_MAIN_PAGE);
      }
    break;  

Step 2: Rename your new template

  • Copy templates/aabox/main_page.tpl.php to a new file named main_page2.tpl.php. Then edit main_page2.tpl.php to your liking.
  • This will be your new custom framework.

Step 3: Change the template linkage

  • Edit <whatever>.php page in the main /catalog directory that you want to use the new template, and change this:

include (bts_select('main', $content_template)); // BTSv1.5  
To this:
include (bts_select('main2', $content_template)); // BTSv1.5  

* This tells that page to load the new main_page2.tpl.php instead of main_page.tpl.php.

  • Bookmark at
  • Bookmark "Create custom per page templates" at Digg
  • Bookmark "Create custom per page templates" at Furl
  • Bookmark "Create custom per page templates" at Reddit
  • Bookmark "Create custom per page templates" at Google
  • Bookmark "Create custom per page templates" at StumbleUpon
  • Bookmark "Create custom per page templates" at Technorati
  • Bookmark "Create custom per page templates" at Facebook
  • Bookmark "Create custom per page templates" at Twitter
  • Bookmark "Create custom per page templates" at Slashdot
custom_per_page_templates.1256911895.txt.gz ยท Last modified: 2009/10/30 09:11 by pgmarshall
You are here: startcustom_per_page_templates
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0