Magento Forum

keeping naming convention but changing class to ID
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

a quick glance on the style sheets, it seems suffer a bit of classities.  Due to my own coding habit, I want to change some classes to IDs (take ‘.head’ for example, I think it deserves #id) however I want to keep the naming convention so that I can have a quick jump start without spending too much time to understand XML and PHTML files. 

Qustion, if I change
.head to #head, will it affect anything in XML and PHTML files, do I have to make changes there accordingly?
take this for instance:  <block type="page/html_header" name="header" as="header">
If not seeing the style sheet, there is no way to tell whether ‘header’ in the name attribute is ID or class.

thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

XML files shouldn’t be affected (no guarantees) but you will have to update your PHTML files. I plan on releasing a theme down the road that simplifies the markup and CSS a great deal! But until then, you’ll have to drag yourself through all the template and css files and make the changes by hand.

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

Thanks Scott, that’s what I thought but I wanted to make sure of it.
Something came out with a designer yesterday thus prompting me to ask again: he did a layout and asked me to take a look due to a IE problem; I saw that he uses clases only, not a single ID is used. He said he is prohibitted from using ID in CSS because it’s being deserved for programmers. I never heard anything like this before, but seeing Magento demo store’s stylesheets, maybe there really has a reason for it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott
Guru
 
Avatar
Total Posts:  333
Joined:  2007-08-31
Northwest Ohio
 

Ids are typically used for javascript programming when manipulating the Document Object Model (DOM, essentially the elements on the page). I can see where someone would say that they are not allowed to use IDs but I do think it’s going a bit too far. Rather than having such restrictions, I could see maybe requiring a certain prefix to all the IDs the designer(?) uses. Then again, I don’t really see programmers using IDs like container, header, nav, sidebar, footer, etc… Just a thought.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top