lacking unique class and id tags

Has anyone else noticed there is a extreme lack of unique class and id names on a lot of the pages?



It makes it very difficult to select specific thing on particular pages with CSS alone. Given enough class names many significant changes could be made with CSS and JS without having to modify any of the core code.



I noticed in the upgrade from 2.0.12-2.0.14 a number of class names that were used in the main pruduct listing page are now gone. So now none of my css selectors match anything and it was very difficult to begin with the find unique ones.



Also the CSC developers really have to realize that other developers are working on their code to customize it. Sticking with good naming conventions helps.

What’s up with class=“product_info” and id=“product-info” on different items. Talk about confusing.



The developers should be working on adding more unique classes. Having lots of classes doesn’t affect anything adversely and makes it much more customizable.



For example, I added {$controller} to my id=container DIV in main.tpl. Now I can specify how I want stuff to look based on controller. It’s really not brain numbing to think of nice little places to add classes.



On the product page the product-image class was removed from a tag surrounding the main image, so now how am I supposed to add a css shadow to it? It has the class cm-thumbnails, but so do many other images on that page.



You added a


and forced this dashed line. If you had enough class tags, you could have just added border-bottom:1px dashed #666;



It’s bad coding form and makes it a real PITA for developers.



Sigh

[QUOTE]Has anyone else noticed there is a extreme lack of unique class and id names on a lot of the pages?



It makes it very difficult to select specific thing on particular pages with CSS alone. Given enough class names many significant changes could be made with CSS and JS without having to modify any of the core code.[/QUOTE]



Yes, I also agree that it would be quite helpful and a major time saver if more cosmetic type changes could be made directly from the styles sheets vs. digging into template code…


[QUOTE]I noticed in the upgrade from 2.0.12-2.0.14 a number of class names that were used in the main pruduct listing page are now gone. So now none of my css selectors match anything and it was very difficult to begin with the find unique ones.[/QUOTE]



I found this same situation which made it very difficult to to simulate the way the product pages looked prior to this upgrade to 2.0.14

The CSS is poorly written, unoptimized, and not consistent throughout the pages. I think it’s a big factor in why you don’t see more themes. The last thing I want to do is change templates to use a custom class and in-line css is not the solution. It’s not a problem if you like the current themes and don’t need any changes.

I added this to the ideas box.



[url]http://cscart.uservoice.com/forums/40782-general/suggestions/607831-add-lots-of-extra-classes-and-id-s-on-all-sections[/url]


[QUOTE]CSS and JS requires lots of unique classes and id’s in order to target different items. If there aren’t enough, then it makes it difficult to only use CSS and JS to modify the html. It’s a very simple thing to add extra classes to be able to target with CSS and JS, so it wouldn’t be such a major task if one knows where the template files are called at different locations.



For starters a simple class to add would be the controller name to div#content, or even body so everything is covered. Specific classes on span’s that have text that might need to be changed. Specific classes on particular buttons in different locations.



Currently for some items very long strings of CSS selectors to target them. It’s not the easiest thing when you need to go:

div > table > td > span > a > img.cm-image { }

just to target something simply because there are other cm-image classes that you don’t want to target.



Very simple idea that would be just as simple to implement, yet would provide huge benefits by allowing simple CSS selectors.



Simple, right?[/QUOTE]

Another example, on the product info page in 2.0.12 there was:









In 2.0.14 it changed to:






Before css could easily target that section. Now it's forced to float and the selectors make much less sense.
Sure I can go

div#product_info div#product-info div.float-left {
float:none;
}

but isn't that kind of stilly?

It's like the developers pride themselves on 'let see how nonsensical we can make our selectors, yeah, we're good'

[url]http://forum.cs-cart.com/showthread.php?t=16460[/url]

Yet another issue,

there are some places where depending on certain options, the containers change.



If there is a list price and a selling price where it shows a discount, the price is placed in a

. Makes sense and targetable.



But if there is no discount and it simply shows price, then the surrounding div is




How can anything be done with that? You can’t make conditional css, should we start writing all css with js now?





I was looking at some of CSCs js code, specifically previewer.js and some changes between .12 and .14

They need to use so many parent() child() and find() selectors it’s crazy. How did it no occur to them, how about we add more classes? The extra classes would save tons of time in js processing over searching the dom.

I totally agree.

If you try to differ from the deafault and make a nice costum design in cscart, it is a mess.

Then make sure to vote!

[url]http://cscart.uservoice.com/forums/40782-general/suggestions/607831-add-lots-of-extra-classes-and-id-s-on-all-sections[/url]

Another reason this i a problem:

[url]http://forum.cs-cart.com/showthread.php?t=16204[/url]



All that should be needed is some css for a width, height, and background image for a and a:hover. But if you do that, it affects too much since there aren’t any tags to target the single button specifically. So instead, template modifications are required. That shouldn’t be acceptable.

OMFG



How is it they can be so dense as to manage to continually remove useful CSS tags with every version they put out?!!! The goal is to make it easier, f’n a.



Before there was a convenient class named “category-description” on the div surrounding, get this, category description, that’s like, totally makes sense. But now it’s been replaced with a contextually meaningless “compact margin-bottom”, f***ing brilliant !



It’s two steps forward, one step back… NOT one step forward, two steps back. Figure it out.



If category-description had been replaced by something contextually meaningful, or if it’s parent had, it would be fine, but there was no reason for it to be removed.

@phazei



You might want to look at this thread for ideas. [url]http://forum.cs-cart.com/showthread.php?t=19385[/url]



I think that if there was a way to dynamically add a unique ID or Class to the Body tag, than you are not limited to different template designs on each page.



I was excited to see that I can do this for the Top Menu items.

It’s not a problem for me to go in and add classes. I’ve done that in a few places. All the body tags have the class “my_{$controller}”. I’ve also added classes in a number of other place. The thing is, that isn’t something I should have to do. If they want to make a cart that developers like, all that should already be in place. Modding all that is also a huge pain durring upgrades as there are so many changes.



I also detest smarty, but that’s besides the point.