Ebay templates coding has some pitfalls, and some research had been made recently to circumvent them. Here’s how to avoid problems with ebay product template coding.
- Ebay will cut
html
,body
andhead
tags, so don’t include them into template. - Page anchors will not work, javascript must be used.
- Some JavaScript is ok to have on Ebay template, but it must reside inside the code, no external links allowed.
- Don’t add
// comments
in javascript, they are supposed to comment out a line, but ebay will put all of your javascript into 1 line, so your js will not function. - It’s a good idea to have your template wrap class name before every next class or ID, this way you’ll be sure not to touch ebay page classes.
- On first load of template ebay will use mixed styles which will come partly from ebay page – so every CSS style you don’t assign specifically, will get a style declaration from eBay CSS. Some elements can look different because of that. Assign CSS style to every element. Example: If you don’t have a special style for Paragraph it will get CSS from ebay, like
line-height:1
, no margins, etc. After page reload your template will be put iniframe
, and your styles will be back, but you must achieve same look. Styles must have unique names, I add something before every name I assign to a class or ID, i.e..idb_about
- Default background of ebay is gray, so if you don’t add i.e. white background to your wrapper, on some screens you’ll get a gray background.
- Make your template responsive, users have different screen sizes.
- When adding font-family declarations, don’t use double quotes, they won’t work in Internet Explorer, use single quotes for font names:
font-family: 'Helvetica neue', Helvetica, Verdana, Sans-serif;
- Prepare template to look the same in “quirks mode”.
- Add
box-sizing: border-box;
to input fields. otherwise you’ll have different field size on first load and after reloading. - Inline style is a good solution for elements. But sometimes it’s enough to add
line-height
,font
andcolor
to a wrapper of your template.
Hi Iggy, how can I load external css font, like google Font, on very first item load? I cant find any Trick to show the right Font on first loading. Do you have an idea? Thank you sass Matthias
sorry, didn’t tried to load external fonts yet, but if they did loaded on first load, probably you just need to force your elements to use them, maybe with !important etc. But didn’t tried that, so can’t tell for sure.