VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: guybr on October 29, 2014, 08:06:49 AM

Title: editing category views distorts the display
Post by: guybr on October 29, 2014, 08:06:49 AM
Hi, I created a working conditional command (for the VM homepage) to display 3 columns of products if a device is mobile (I hardcoded the variables), or to use the CP setting for number of columns if otherwise - and it works perfectly.

However, if I use the same approach on the category view (default.php and categories.php) - only the mobile command renders well, and ironically the original php command to determine the number of columns as per the Control Panel yields a distorted display:
- The product browse section displays various numbers of products per line - their containers are stretched more or less than they should be
- the category listings at the top of the page are no longer centered (but do at least adhere to the CP setting of 4 columns)

What am I doing wrong? Why should the original php commands not manage to get the PC to display the page as it always did? Is there something unique to the coding of the category view that makes it harder to edit?

I'm using VM 2.6.6

UPDATE: just noticed what may be the problem - but I have no idea why: with the changes I made as above, on PC the <h2> product name doesn't text-wrap: it displays the text on 1 line - and if that line is long, so it the product display box... but why?? Oddly on mobile, it renders just like it should...

I tried adding a text-wrap command to the css but it doesn't fix the problem. Here's the css for the product title display: (the same coding works fine on VM homepage, so again, what is unique about the Category view??)

.productlistingtitlebox {
   max-width: 100%;
   height: 85px;
   width: auto;
   display: block;
   background-color: #f5f5dc;
   overflow: hidden;
        padding: 2px 2px 2px 2px;
   font-size: 100%;
   border-top:solid #D2B48C 1px;
   border-right:solid #D2B48C 1px;
   border-left:solid #D2B48C 1px;
   word-wrap:break-word;
}
Title: Re: editing category views distorts the display
Post by: GJC Web Design on October 29, 2014, 09:48:01 AM
without a live url it is very doubtful anyone can help

also 2.6.6 is out of date and unsafe.
Title: Re: editing category views distorts the display
Post by: guybr on October 29, 2014, 10:17:25 AM
can I send you a URL via PM?
Title: Re: editing category views distorts the display
Post by: GJC Web Design on October 29, 2014, 10:23:10 AM
nope - that then becomes paid consultancy... or if you want to employ me...