Results 1 to 6 of 6

Categories On Front Page

This is a discussion on Categories On Front Page within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi all I used a good contrib in OSC to show a picture grid of all categories on the front ...

      
  1. #1
    Lurker
    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0


    Default Categories On Front Page

    Hi all I used a good contrib in OSC to show a picture grid of all categories on the front page but can't seem to get it working in OSCMAX. How does this WYSIWYG editor affect changes to the index.php code?


    The code I used is below.

    PHP Code:
     <table border="0" width="1000" cellspacing="0" cellpadding="10" align="center">
      <tr>
        <td width="<?php echo BOX_WIDTH?>" valign="top" background="aqb/images/left_column.jpg"><table border="0" width="<?php echo BOX_WIDTH?>" cellspacing="2" cellpadding="2">
    <!-- left_navigation //-->
    <?php require(DIR_WS_INCLUDES 'column_left.php'); ?>
    <!-- left_navigation_eof //-->
        </table></td>
    <!-- body_text //-->
    <?php
    if ($category_depth == 'nested') {
        
    $category_query tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.categories_id = '" . (int)$current_category_id "' and cd.categories_id = '" . (int)$current_category_id "' and cd.language_id = '" . (int)$languages_id "'");
        
    $category tep_db_fetch_array($category_query);
    ?>
        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td><h1><?php echo $category['categories_htc_title_tag']; ?></h1></td>
               <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTHHEADING_IMAGE_HEIGHT); ?></td>
              </tr>
               <?php if (tep_not_null($category['categories_htc_description'])) { ?> 
              <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
              </tr>
    <?php if (DISPLAY_CATS_ON_MAIN == 'true'){
            include(
    DIR_WS_MODULES FILENAME_CAT_TEXTBOX_MODULE); // added for Subcategory textboxes
        
    }
    ?>
    <?php 
    if (DISPLAY_CATS_ON_MAIN == 'true'){
            include(
    DIR_WS_MODULES FILENAME_CAT_TEXTBOX_MODULE); // added for Subcategory textboxes
        
    }
    ?>
              <tr>
               <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
              </tr>
              <?php ?>
            </table></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
          </tr>
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
    <?php
        
    if (isset($cPath) && strpos('_'$cPath)) {
    // check to see if there are deeper categories within the current category
          
    $category_links array_reverse($cPath_array);
          for(
    $i=0$n=sizeof($category_links); $i<$n$i++) {
            
    $categories_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "'");
            
    $categories tep_db_fetch_array($categories_query);
            if (
    $categories['total'] < 1) {
              
    // do nothing, go through the loop
            
    } else {
              
    $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
              break; 
    // we've found the deepest category the customer is in
            
    }
          }
        } else {
          
    $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$current_category_id "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
        }

        
    $number_of_categories tep_db_num_rows($categories_query);

        
    $rows 0;
        while (
    $categories tep_db_fetch_array($categories_query)) {
          
    $rows++;
          
    $cPath_new tep_get_path($categories['categories_id']);
          
    $width = (int)(100 MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
          echo 
    '                <td align="center" class="smallText" width="' $width '" valign="top"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '">' tep_image(DIR_WS_IMAGES $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br>' $categories['categories_name'] . '</a></td>' "\n";
          if (((
    $rows MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
            echo 
    '              </tr>' "\n";
            echo 
    '              <tr>' "\n";
          }
        }

  2. #2
    osCMax Testing Team
    Join Date
    Mar 2008
    Location
    The Netherlands
    Posts
    37
    Rep Power
    0


    Default Re: Categories On Front Page

    If i read your code quick then i see it isnt following the BTS code that OSCmax uses, so instead of putting it in index.php you should put it in templates/template_name/content/index_nested.tpl.php

    but i could be wrong ofcourse.

  3. #3
    Lurker
    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0


    Default Re: Categories On Front Page

    Thanks for the suggestion Gizmor - not being familiar with the OSCMAX code I'm struggling to implement it. The default AABOX template doesn't seem to have the index_nested file you mention so i tried the main_page.tpl.php but i'm not sure where to put the code or how much of it i need to copy over

  4. #4
    osCMax Testing Team
    Join Date
    Oct 2006
    Location
    Atlanta GA
    Posts
    193
    Rep Power
    12


    Default Re: Categories On Front Page

    Then you need to look in:

    templates/fallback/content/index_nested.tpl.php

  5. #5
    Lurker
    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0


    Default Re: Categories On Front Page

    Thanks for the suggestion but adding the code into that file doesn't seem to do anything. Does anyone know how to integrate this contrib?

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,500
    Rep Power
    567


    Default Re: Categories On Front Page

    You have to add the code correctly

    See the BTS template primer for info on how to add mods to the template sytem.
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

Similar Threads

  1. Front Page?
    By justedee in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 08-14-2007, 10:21 AM
  2. Products/Categories on front page
    By webguy262 in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 08-01-2005, 06:45 AM
  3. change front page?
    By lil-raskals in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 09-28-2004, 01:19 AM
  4. Products/Categories on front page
    By webguy262 in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 05-12-2004, 05:31 PM
  5. Am I right about the front page products?
    By elijahweb in forum osCommerce 2.2 Modification Help
    Replies: 5
    Last Post: 01-25-2003, 12:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •