Author Topic: Page Class Suffix ?!? - have different category headers??  (Read 4839 times)

FatalMusic

  • Jr. Member
  • **
  • Posts: 55
Page Class Suffix ?!? - have different category headers??
« on: May 25, 2008, 17:40:34 pm »
Is it correct that Virtuemart does not recognize the page class suffix?

I entered a suffix in each menu item, but Virtuemart doesn't use it at all :(

I need this CSS (or something that gives the same result in VM) to do its job:

.componentheading_singles {
background-image: url(../images/singleshd.gif);
background-repeat: no-repeat;
background-position: left top;
text-align: left;
margin: 0px;
padding: 0px;
height: 25px;
font-family: Arial, Helvetica, sans-serif;
font-size: 0px;
color: #2c0021;
}
.componentheading_albums {
background-image: url(../images/albumshd.gif);
background-repeat: no-repeat;
background-position: left top;
text-align: left;
margin: 0px;
padding: 0px;
height: 25px;
font-family: Arial, Helvetica, sans-serif;
font-size: 0px;
color: #2c0021;
}
.componentheading_compilations {
background-image: url(../images/compilationshd.gif);
background-repeat: no-repeat;
background-position: left top;
text-align: left;
margin: 0px;
padding: 0px;
height: 25px;
font-family: Arial, Helvetica, sans-serif;
font-size: 0px;
color: #2c0021;
}

Virtuemart includes that browse_header_category.tpl.php file and it does not call the page class suffix.

When I add a div + class and <?php echo $this->params->get('pageclass_sfx');?>, it gives an error:

Fatal error: Call to a member function on a non-object in ../browse_header_category.tpl.php on line 3

How can i tweak it so that i can get this to work again?
Instead of having 1 generic header for all my categories?

-> also the page title, set inside each menu item, is not recognized... i really hope this component works with the extensive css possibilities of joomla 1.5..

FatalMusic

  • Jr. Member
  • **
  • Posts: 55
Re: Page Class Suffix ?!?
« Reply #1 on: May 27, 2008, 09:35:52 am »
80 views and no reply? Are there any support ppl around?
I really hope someone can give an answer about this... pretty please..

FatalMusic

  • Jr. Member
  • **
  • Posts: 55
Re: Page Class Suffix ?!? - have different category headers??
« Reply #2 on: June 03, 2008, 12:21:50 pm »
I don't know if this is the best option but since no reply was given to my answer, i'm happy I figured out a solution that works, while i'm not a php wizard!

For people who like to have a separate header image for each category.
I created a different browse_header_category.tpl.php for each of my category. Defining a different css class inside each to call the header background image.

This is what I changed in the shop.browse.php file:


Starting from line 92:

   // NOW START THE PRODUCT LIST
   $tpl = vmTemplate::getInstance();
   
   if( $category_id == 1 ) {
      /**
       * CATEGORY DESCRIPTION SINGLES
       */      
      $browsepage_lbl = $category_name;
      $tpl->set( 'browsepage_lbl', $browsepage_lbl );      
      
      $tpl->set( 'desc', $desc );
         
      $category_childs = $ps_product_category->get_child_list($category_id);
      $tpl->set( 'categories', $category_childs );
      $navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
      $tpl->set( 'navigation_childlist', $navigation_childlist );

      // Set up the CMS pathway
      $category_list = array_reverse( $ps_product_category->get_navigation_list($category_id) );
      $pathway = $ps_product_category->getPathway( $category_list );
      $vm_mainframe->vmAppendPathway( $pathway );

      $tpl->set( 'category_id', $category_id );
      $tpl->set( 'category_name', $category_name );
      
      $browsepage_header = $tpl->fetch( 'browse/includes/browse_header_categorysingles.tpl.php' );
      
   }
   elseif( $category_id == 2 ) {
      /**
       * CATEGORY DESCRIPTION ALBUMS
       */      
      $browsepage_lbl = $category_name;
      $tpl->set( 'browsepage_lbl', $browsepage_lbl );      
      
      $tpl->set( 'desc', $desc );
         
      $category_childs = $ps_product_category->get_child_list($category_id);
      $tpl->set( 'categories', $category_childs );
      $navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
      $tpl->set( 'navigation_childlist', $navigation_childlist );

      // Set up the CMS pathway
      $category_list = array_reverse( $ps_product_category->get_navigation_list($category_id) );
      $pathway = $ps_product_category->getPathway( $category_list );
      $vm_mainframe->vmAppendPathway( $pathway );

      $tpl->set( 'category_id', $category_id );
      $tpl->set( 'category_name', $category_name );
      
      $browsepage_header = $tpl->fetch( 'browse/includes/browse_header_categoryalbums.tpl.php' );
      
   }
   elseif( $category_id == 3 ) {
      /**
       * CATEGORY DESCRIPTION COMPILATIONS
       */      
      $browsepage_lbl = $category_name;
      $tpl->set( 'browsepage_lbl', $browsepage_lbl );      
      
      $tpl->set( 'desc', $desc );
         
      $category_childs = $ps_product_category->get_child_list($category_id);
      $tpl->set( 'categories', $category_childs );
      $navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
      $tpl->set( 'navigation_childlist', $navigation_childlist );

      // Set up the CMS pathway
      $category_list = array_reverse( $ps_product_category->get_navigation_list($category_id) );
      $pathway = $ps_product_category->getPathway( $category_list );
      $vm_mainframe->vmAppendPathway( $pathway );

      $tpl->set( 'category_id', $category_id );
      $tpl->set( 'category_name', $category_name );
      
      $browsepage_header = $tpl->fetch( 'browse/includes/browse_header_categorycompilations.tpl.php' );
      
   }   

then the rest of the original code follows

   elseif( $manufacturer_id) {
      $db->query( "SELECT manufacturer_id, mf_name FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
      $db->next_record();
      $mainframe->setPageTitle( $db->f("mf_name") );


Result printscreens attached.


[attachment cleanup by admin]