Author Topic: Borders in browse page  (Read 1773 times)

atlew

  • Beginner
  • *
  • Posts: 3
Borders in browse page
« on: October 14, 2012, 13:15:55 pm »
I am struggeling to make my browse page clean with borders. I have tried out some of the suggestion in other threads like this. http://forum.virtuemart.net/index.php?topic=82069.0 but when i do the modifikation on the no borders PHP file it makes my page go blank. What am i missing here. VM 1.1.9 and Joomla 1.5.26.
According to the article i should change the php file like this.


""""""
What you have to do it choose "browse no tables"

Then modify

templates/browse/includes/browse_notables.tpl

In order to make the site look correctly no matter how many products per row, I have a few if statements, and change the html for each one individually.


here is my code, you will have to adjust it to your template.
open browse_notables.tpl

change this line
      echo "<div style=\"margin-right: 5px; width:". intval(round(100/$cell_count)-2) ."%; float:left;\" id=\"".uniqid( "row_" ) ."\">";

to this

Quote

          if( $cell_count < 4 ) {
                      $cell_count = 4;
                }

          if( $cell_count == 4 ) {
                            echo "<div style=\"margin: 2px;border:1px solid #b8b8b8; width:233px; float:left;\" id=\"".uniqid( "row_" ) ."\">";
                }
                elseif( $cell_count == 5 ) {
                            echo "<div style=\"margin: 2px;border:1px solid #b8b8b8; width:185px; float:left;\" id=\"".uniqid( "row_" ) ."\">";
                }
                elseif( $cell_count == 6 ) {
                            echo "<div style=\"margin: 2px;border:1px solid #b8b8b8; width:". intval(round(100/$cell_count)-1) ."%; float:left;\" id=\"".uniqid( "row_" ) ."\">";
                }
                      else {
                            echo "<div style=\"margin: 2px;border:1px solid #b8b8b8; width:". intval(round(100/$cell_count)-1) ."%; float:left;\" id=\"".uniqid( "row_" ) ."\">";
                }

"""""""

Any ideas on what i am missing here??

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3025
  • VirtueMart Version: 3.6.3
Re: Borders in browse page
« Reply #1 on: October 14, 2012, 14:46:05 pm »
My suggestion is to keep the browse_notables.tpl.php simple you should not require any IF statements


Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__); ?>


<?php echo $buttons_header // The PDF, Email and Print buttons ?>

<div class="details-catbar">
<div class="catbar-text">
<?php echo $browsepage_header // The heading, the category description ?>
</div>
</div>

<?php echo $parameter_form // The Parameter search form ?>
<div id="product_list">
<?php
$data 
=array(); // Holds the rows of products
$i $row $tmp_row 0// Counters
$num_products count$products );

foreach( 
$products as $product ) {

foreach( $product as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set$attr$val );
}

// Parse the product template (usually 'browse_x') for each product
// and store it in our $data array 
echo $this->fetch_cache'browse/'.$templatefile .'.php' );


}
?>

</div>
<br class="clr" />
<?php 
echo $browsepage_footer;

//Re-enable this block if you wish to add the featured products and recent products block to the bottom of the page.
//------------------------------------------------------
// Show Featured Products
//if( $this->get_cfg( 'showFeatured', 1 )) {
    /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
    edit featuredproduct.tpl.php to edit layout */
//    echo $ps_product->featuredProducts(true,10,true);
//}
//echo $recent_products;
//-------------------------------------------------------
?>


Then modify the relevant browse files browseX.php

I encompass the browse templates in a related <div> e.g. <div class="browse3"> for 3 accross <div class="browse4"> for 4 column

Using CSS you can then set whatever widths you require:-

.browse3 {width:30%; min-height:nnnpx;}
.browse4 {width:22%; min-height:nnnpx;}

And you can also adjust any subordinate element for a specific browse div if required using CSS.
.browse3 .heading {xxx;}
.browse2 .heading {xxx;}

No need for harding coding widths just some simple CSS and very easy to adjust when testing designs out using firefox and firebug






regards
A

Joomla 3.9.12
php 7.2