prestashop1.5 breadcrumb添加样式

之前在一个论坛里回复过这个问题,最近又有人咨询这个问题。我想想还是写下来分享给做模板的前端攻城师。

prestashop默认版本产品相关页 breadcrumb最后的节点是文本,没有任何html标签包裹。 加上标签后就可以写css样式修饰了。

1. 打开controllers/front/ProductController.php;
2. 查找到 protected function assignCategory() 大约在436行;
3.将代码 修改为;
protected function assignCategory()
{
// Assign category to the template
if ($this->category !== false && Validate::isLoadedObject($this->category))
{
$this->context->smarty->assign(array(
‘path’ => Tools::getPath($this->category->id, ‘<span  “nav_last”>’.$this->product->name.'</span>’, true),
‘category’ => $this->category,
‘subCategories’ => $this->category->getSubCategories($this->context->language->id, true),
‘id_category_current’ => (int)$this->category->id,
‘id_category_parent’ => (int)$this->category->id_parent,
‘return_category_name’ => Tools::safeOutput($this->category->name)
));
}
else
$this->context->smarty->assign(‘path’, Tools::getPath((int)$this->product->id_category_default, ‘<span class=”nav_last”>’.$this->product->name.'</span>’));

$this->context->smarty->assign(‘categories’, Category::getHomeCategories($this->context->language->id));
$this->context->smarty->assign(array(‘HOOK_PRODUCT_FOOTER’ => Hook::exec(‘displayFooterProduct’, array(‘product’ => $this->product, ‘category’ => $this->category))));
}

产品页面breadcrumb 最后一个节点添加span标签

产品页面breadcrumb 最后一个节点添加span标签

 

 

 

prestashop1.5 breadcrumb添加样式》有398个想法

  1. activate windows by kms

    An outstanding share! I’ve just forwarded this onto a colleague who was doing a little homework on this. And he in fact ordered me breakfast simply because I stumbled upon it for him… lol. So let me reword this…. Thanks for the meal!! But yeah, thanks for spending some time to talk about this topic here on your blog.|

    回复
  2. Lowell Sloma

    Greetings! I’ve been following your blog for some time now and finally got the bravery to go ahead and give you a shout out from New Caney Texas! Just wanted to mention keep up the great work!|

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注