Guest Posted December 25, 2009 Share Posted December 25, 2009 大家好,我的网站产品排列变形了,如图,原因是同一行里有的产品名称太长多占了一行导致的,想请教如何让显示限定个产品名称字符如ASP有个LEFT函数,但我不熟PHP,请教大家了!谢谢! Link to comment Share on other sites More sharing options...
21846657 Posted December 27, 2009 Share Posted December 27, 2009 在相关的tpl里,有这段代码:{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}。调整truncate:后面的数字来定义产品名称的字符数。看你的附图,我觉得,根本原因是CSS没设置好。 Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2009 Share Posted December 27, 2009 prestashop\css\global.css/* product-list.tpl */ul#product_list{ list-style-type:none;width:550px; }ul#product_list li { background: #d0d3d8 url('../img/block_category_item_bg.jpg') repeat-x; padding: 1px; float: left; border: solid 1px #d0d3d8; width:129px; height:180px; margin-bottom:0.3em; margin-left:0.1em;}ul#product_list li a { text-decoration:none; color:#374853;}ul#product_list a.product_img_link{ border: solid 1px #d0d3d8; margin-right:0.6em;}ul#product_list a.product_img_link img{ vertical-align:bottom;}ul#product_list li h3{ margin:0.4em 0; }ul#product_list li .new{ background:transparent url(../img/flag_new_bg.jpg) repeat-x scroll 0%; border:1px solid #488C40; color:white; font-size:0.6em; font-weight:bold; margin:0pt 1em 0pt 0pt; padding:0pt 0.4em; text-transform:uppercase; vertical-align:0.3em;}ul#product_list li p.product_desc{ font-size:0.92em; }ul#product_list li div.center_block{ width:74%;}ul#product_list li div.right_block{ text-align:center; margin-left:1em; margin-top:0;}ul#product_list li .discount{ color:#da0f00; text-transform:uppercase; font-weight:bold; display: block;}ul#product_list li .on_sale{ color:#da0f00; text-transform:uppercase; font-weight:bold; display: block;}ul#product_list li .reduction { display: block; margin-bottom: 0.3em;}ul#product_list li .price{ display: block; font-size: 1.5em; margin-bottom: 0.2em;}ul#product_list li span.availability{ float: right; color:#488c40; font-size:0.9em;}ul#product_list li a.button{ margin-top:0.5em; }这里是我改的CSS,请教要改哪里才能解决上面的这个问题呢? Link to comment Share on other sites More sharing options...
21846657 Posted December 27, 2009 Share Posted December 27, 2009 1. ul#product_list li h3 加入height: 30px;2. ul#product_list li 加入height: 240px;3. 测试 Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2009 Share Posted December 27, 2009 21846657 ,爱死你了,谢谢! Link to comment Share on other sites More sharing options...
mint^^ Posted March 4, 2010 Share Posted March 4, 2010 在相关的tpl里,有这段代码:{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}。调整truncate:后面的数字来定义产品名称的字符数。看你的附图,我觉得,根本原因是CSS没设置好。 我按照你说的改了,可是字还是那么多…… Link to comment Share on other sites More sharing options...
mint^^ Posted March 4, 2010 Share Posted March 4, 2010 另外,v13a2怎么把名字改在图片上面了,看起来好不习惯啊……那个怎么改回到图片底下啊? Link to comment Share on other sites More sharing options...
mint^^ Posted March 4, 2010 Share Posted March 4, 2010 以解决……好用的,我在本地改的 produt-list.tpl,在网上使劲刷新当然没反应了……今天是怎么了……现在已经好用了:) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now