Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / HELP with Mod: "Column Layout Grid for Product Listing"

HELP with Mod: "Column Layout Grid for Product Listing"

Locked

Views: 1,641

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
9 Oct 2007, 7:09 PM
#1
ajstocco avatar

ajstocco

New Zenner

Join Date:
Oct 2007
Posts:
2
Plugin Contributions:
0

HELP with Mod: "Column Layout Grid for Product Listing"

I'm using this mod (http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=77), but the default 3 column layout sets a style width to 32.5%. I'd like to change that to a specific pixel width. I know it's going to a 3 column layout so I can "hard code" that information if necessary.

Can anybody save me?

21 Oct 2007, 2:27 AM
#2
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

Re: HELP with Mod: "Column Layout Grid for Product Listing"

You need to edit product_listing.php, which can be found in /includes/modules/.

Make a copy and put it in /includes/modules/your_template.

Now go to around line 237 and you should see this

$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',

Replace the $col_width variable with the size columns you want. Here is what the code would look like if you wanted 100px columnns.

$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:100px;"',
3 Mar 2008, 8:06 PM
#3
prattski avatar

prattski

New Zenner

Join Date:
Nov 2007
Posts:
19
Plugin Contributions:
0

Re: HELP with Mod: "Column Layout Grid for Product Listing"

Another way to do it is to add some CSS to style the width of the element, just make sure to put !important there:

whatever it is {
width: 100px !important;
}

4 Mar 2008, 12:10 AM
#4
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: HELP with Mod: "Column Layout Grid for Product Listing"

I have a slight similar question that I don't think is necessary to create a new thread. I'm trying to remove the space inbetween the title name, and the price. I think there's a space for another include, but I'm not sure which.

What can I remove/replace to remove that simple space?

http://www.thuyvancollection.com/index.php?main_page=index&cPath=13

4 Mar 2008, 12:32 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: HELP with Mod: "Column Layout Grid for Product Listing"

That space is the div for the description. You can edit out the code for that in product_listing.php:php case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; Change to:```php
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>';
}
break;

You could also do this in your stylesheet with 

.listingDescription {display: none;}
4 Mar 2008, 6:14 AM
#6
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: HELP with Mod: "Column Layout Grid for Product Listing"

gjh42:

That space is the div for the description. You can edit out the code for that in product_listing.php:php case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; Change to:```php
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>';
}
break;

> You could also do this in your stylesheet with 
> 
> .listingDescription {display: none;}

I tried using both codes you listed, but neither seemed to have any effect.   I also checked in both Safari and Firefox.  Am I doing something wrong, or was the code in error?
4 Mar 2008, 6:02 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: HELP with Mod: "Column Layout Grid for Product Listing"

At least in Firefox, the empty div is not taking any space, so deleting it will not have a visible effect.
What will work is to hide the <br /> following that div:

.listingDescription+br {display: none;}

Unfortunately, IE6 does not understand the adjacent selector construction, so this will not work there.
You will need to remove one or more <br /> tags and possibly some surrounding PHP quotes following the description and preceding the price in product_listing.php.

5 Mar 2008, 4:20 AM
#8
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Re: HELP with Mod: "Column Layout Grid for Product Listing"

Great that last code actually worked for all of the updated browsers to date (IE7, FF2, Safari). Thanks!

5 Mar 2008, 7:01 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: HELP with Mod: "Column Layout Grid for Product Listing"

In this case, since the change is really just cosmetic, maybe you can be OK with having IE6 users get a slightly less than perfect display. I doubt they will even realize that anything is wrong.