If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Using one single listing template

Using one single listing template

Started by yellow1912 on 31 Dec 2007, 11:21 PM · Views: 90,908

Results 301 to 320 of 327
25 Apr 2012, 1:26 PM
#301
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Using one single listing template

hmartens:

I'm running zencart 1.3.9h and installed the SLT v1.8. I did everything as per readme but a couple of things went haywire and nothing went better! For starters, my frontpage that displayed all the latest products added, now shows random products and changes everytime you hit refresh. New Products still displays 1 per line as it always did. And under "All Products" there are NO products displayed!

Please help! I followed every step and don't know why it's not working (and it's a LIVE site!)Never never EVER make changes to your live site.. Before you do ANYTHING ELSE, you need to roll back your changes.. then start over by creating a backup site for testing changes before implementing them in a live environment...

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

25 Apr 2012, 2:28 PM
#302
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

This is a complicated mod with complicated merges. It is evident from the thread that it works but there is a lot of scope for user mistakes.
I don't support it as I don't have the time.

All I can say is that anyone who implements ANY mod to a live site without installing and checking it out thoroughly on a local or remote mirror AND taking file and database backups before uploading really should not be suprised when it goes wrong.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

28 Jul 2012, 10:06 AM
#303
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

I installed this module today and cannot figure out what I've done wrong.

When I change the number of columns in the row, there is always 1 less than the number I set and the next one goes to the next row, then nothing next to it and it goes on to the next row. In other words, if I set the #of columns to 3, 2 columns will show on one row, then 1 column ... then 2 columns on next row, then 1 on the next row ... etc....

If I set it to 5, 4 will show, then 1, 4, then 1...

http://paisleyposey.com/shop/index.php?main_page=index&cPath=5

I have changed the shop width, changed number of columns, changed my column widths via CSS, nothing I do seems to make all the columns per row work correctly.

Please help.

28 Jul 2012, 10:28 AM
#304
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

It is the styling that is causing problems. On the boxes you have both padding and a border. This makes the boxes bigger that they need to be. Which means that they do not fit in the row.

it is this rule

.centerBoxContentsProducts {
margin: 6px 6px 6px 6px;
width: 180px;
height: 225px;
background-position: 4pt 0pt;
text-align: center;
border: 1px solid #9BA038;
}

and this rule

.centeredContent, TH, #cartEmptyText, #cartBoxGVButton, #navCatTabsWrapper, #navEZPageNextPrev, #bannerOne, #bannerTwo,  #bannerThree,  #bannerFour,  #bannerFive,  #bannerSix, #siteinfoLegal, #siteinfoCredits, #siteinfoStatus, #siteinfoIP, .center, .cartRemoveItemDisplay, .cartQuantityUpdate, .cartQuantity, #cartBoxGVBalance, .leftBoxHeading, .centerBoxHeading,.rightBoxHeading, .productListing-data, .accountQuantityDisplay, .ratingRow, LABEL#textAreaReviews, #productMainImage, #reviewsInfoDefaultProductImage, #productReviewsDefaultProductImage, #reviewWriteMainImage, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew, .gvBal, .attribImg {
       padding-right: 15px;
       width:auto;
       text-align: justify;
       line-height: 1.25em;
        }

Nick
iszent.com

28 Jul 2012, 11:21 PM
#305
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

I tried changing that and it made no difference, so I put it back.

I'm not sure how that can be affecting it, because I can put up to 5 on a row, but it ALWAYS, no matter how many I columns I set per row, one will always go to the next row. To verify that this Always occurs, I set it to have only 2 columns per row, and then only 1 image shows per row.

If you look now, you will see 5 images per row, but the columns in admin is set to 6.

Any other ideas/thoughts would be great!

29 Jul 2012, 7:30 AM
#306
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

Sorry, but I am not guessing. This is the most common error with people using column grid, single listing or SNAF. You cannot have padding and borders. Attached is a screen shot of your site with the padding and the margins taken out.

Oh look, there are six per row as there should be :-)

Nick
iszent.com

29 Jul 2012, 8:06 AM
#307
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

Sorry, that should be - you cannot have margins,padding or borders.

Nick
iszent.com

31 Jul 2012, 1:47 PM
#308
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

Thanks. I took out all borders, padding and margins for the columns and it works ... AS LONG AS I set it for 6 or above. I can get 6 or 7 to show correctly, but now 5 and below still shows one on the below row. It's confusing me greatly that I can have MORE columns per row but not fewer than 6 without one going to another row.

Can you take a look again and see if you see anything causing a problem still? Also, with taking out the padding and margins, there isn't space between rows and products, how can I make it look right? If you have a stylesheet you can send me that works, I'd love to get it so I can compare yours and mine.

Any thoughts? I REALLY appreciate your help!! If you can help me and need admin access, I'd be happy to give you temp. admin login. Please help.

Thanks.

31 Jul 2012, 2:00 PM
#309
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

It is the border that is messing it up now.

.centerBoxContentsProducts {
width: 25%;
height: 250px;
text-align: center;
border: 1px solid #9BA038;
}

To get this to work the way it should you need to do some code editing. If you imagine each column as a box then that box needs to be the right width. if it is too wide then it spills over onto the next row.

(The reason it works for higher numbers has to do with rounding errors on the division of the total width by the number of boxes, if you are really interested!)

So the solution is to put another box inside that one and then you can style the inner one and the outer one stays the right size. That edit is done in product_listing.php normally. However, because your's is a template monster template I can't really comment on how to do it. If you look at the most recent version of SNAF (which is only really for Zen 1.5 ) you will find product_listing.php has those alterations. The previous versions of SNAF don't. I put them in there because this is just such a common problem. But as I say, Template Monster templates tend to re-structure everything. so in your case who knows ....

Nick
iszent.com

31 Jul 2012, 2:39 PM
#310
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

I feel so very stupid. I don't really know coding, I manipulate what is there and can add a few things and I've learned a lot on my own and with help from folks like you. But this has me confused.

I downloaded SNAF and used Textpad and compared the files. I decided to try something which was to upload the product_listing.php that came with SNAF. I now can have lower numbers work right! YEAH! However, is there a way to put space between each column and then a bit between rows? It just looks all shoved together.

I think you were trying to explain that to me in your previous reply, but adding a box to put around another box lost me. I don't know how to do that.

I really do appreciate the help and hate to keep asking, but I'm lost. Any more help you can give would be really appreciated.

31 Jul 2012, 4:04 PM
#311
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Using one single listing template

I made the following change to the product_listing.php MODULE FILE

includes/modules/YOUR_TEMPLATE/product_listing.php

ORIGINAL CODE:

  // Used for Column Layout (Grid Layout) add on module
  $column = 0;	
  if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
    if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
      $col_width = floor(100/$num_products_count) - 0.5;
    } else {
      $col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
    }

MY CHANGES

  // Used for Column Layout (Grid Layout) add on module
  $column = 0;	
  if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
    if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
      $col_width = floor(100/$num_products_count) - 1;
    } else {
      $col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 1;
    }

See how I changed it to SUBTRACT a whole number ( 1 full percent) rather than a fraction (0.5) which is a "half a percent".

And as niccol says... don't add margins AND borders AND padding.

You can gently "tweak" the CSS to nudge the display a bit, but by changing the FRACTION (0.5) to a WHOLE NUMBER (1) it works for me.

(You might be able to make that integer GREATER if you want extra space for padding and borders. Try "2" or "3" as well...)

20 years a Zencart User

31 Jul 2012, 4:23 PM
#312
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

You now have the inner box that you need.

(BTW. You need to work out how to use web developer tools in chrome or firebug in firefox so that you can look at this stuff easily on a live page. That is how we can say these things with certainty. It lets us play with the css of your site on our machines.)

Now you need to style the inner box. Something like:

.innerColumn{
border:1px solid red;
margin:10px;
min-height: 280px;
padding:5px;
}

.centerBoxContentsProducts {
height:auto!important;
}

the first bit is to style the inner box and the second bit is just to remove the styling that is already there. so you can adjust the values that are there in the first rule to suit what you want.

like this you can add styling in pretty much any combination you like and it won't break the layout.

No need to feel stupid. This isn't brain surgery or rocket science that takes real brains. It is just coding that relies mainly on having done it before.

Nick
iszent.com

1 Aug 2012, 5:13 AM
#313
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

THANK YOU! THANK YOU! Nick and Schoolboy, I utilized both of your suggestions. I so much appreciate the help. I am going to love the developer's tools! Bit confusing still, but I did play with it some and found how I like it! Awesome tips!

1 Aug 2012, 6:02 AM
#314
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

One more question... hopefully then I'll leave you guys alone.

I have the boxes the way I like, except I'd really like to align the inner contents at the bottom, not at the top. I read up on vertical-align and understand it won't work here, at least the way it is set up. I've played around in the developer's tools and still can't figure it out.

Any suggestions? Once again, the website is: http://paisleyposey.com/shop/index.php?main_page=index&cPath=5

Thanks!

1 Aug 2012, 7:27 AM
#315
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Using one single listing template

One thing to keep in mind is that the contents may change as other factors change. So, for example if you have a specials price added to a product that will cause the contents to 'grow'. Or for that matter a very long product name. So, that is why I tend to use min-height rather than height in the css rules.

Aligning to the bottom is possible but is complex. Actually, if I absolutely have to do it then I tend to use javascript as it has better cross browser compatibility. But that is a bit beyond the scope of a forum post.

The quicker fix is to keep your images consistent sizes. Or if not, at least add a rule to make them so. Something like:

a.product_listing_image_link{
display:block;
height:135px
}

Which at least means that the text under them is kept aligned.

Nick
iszent.com

1 Aug 2012, 7:40 AM
#316
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Using one single listing template

I think it is Glenn Herbert who has developed a module to allow styling of individual elements in the product listing boxes.

20 years a Zencart User

1 Aug 2012, 7:50 AM
#317
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Using one single listing template

THANKS! Perfect! I used that code and now it's great!

You guys are awesome!

13 Aug 2013, 4:07 PM
#318
waterbender avatar

waterbender

New Zenner

Join Date:
May 2010
Posts:
84
Plugin Contributions:
0

Re: Using one single listing template

Hi just a quick question, is this module compatible with the latest zen cart version 1.5.1?

13 Aug 2014, 11:04 PM
#319
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: Using one single listing template

Ditto to Waterbender's question 1.5.1?

I just upgraded to a responsive package and the regular product listing does not work well with small screens (scrunches pictures down to a thin line on products search results listings).

I would prefer to have all of my listings look like the all, new, or featured listings...completely replacing the product listing, search results product listing, and new listing but retaining the sort functions.

Thanks.

14 Aug 2014, 7:04 AM
#320
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

is this module compatible with the latest zen cart version 1.5.1?
It states clearly on the download page that this mod was last used with 1.39.

A common template system will be introduced in ZC 1.6.

I can guarantee it will take you far less time to modify your Zen Cart templates individually than attempting to implement this mod, incorporate the changes since 1.39, go nuts trying to understand how it works, and then take it all out again for the 1.6 upgrade.
Its a merging nightmare and I removed it all recently when upgrading to 1.53.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...