im using OC 3.0.2.0. most of my products has a very long name and i need to have the last piece of breadcrumbs in "product page" to be cut off.
any suggestion plz.
thanks.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
viewtopic.php?t=175516
this is the block of code in my product.twig that generates the breadcrumb
Code: Select all
<ul class="breadcrumb">
{% for breadcrumb in breadcrumbs %}
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
{%
endfor %}
</ul>
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
If you don't have enough coding skills, you can always request a commercial support.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Code: Select all
$data['breadcrumbs'][] = array(
'text' => $product_info['name'],
'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id'])
);
Code: Select all
<ul class="breadcrumb">
{% for breadcrumb in breadcrumbs %}
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
{% endfor %}
</ul>
Choose how you like.
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Code: Select all
.breadcrumb li a {
line-height: 1em;
max-width: 61px;
overflow: hidden;
display: inline-block;
}
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
With this you won't be able to add nice three dot ellipsis in the end :-)paulfeakins wrote: ↑Thu Aug 22, 2019 6:32 pmOr a pure CSS solution:Code: Select all
.breadcrumb li a { line-height: 1em; max-width: 61px; overflow: hidden; display: inline-block; }
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
here i admit that i used to be a software developer for sometime and i know how it feels to make a living with 10 hours and more F5-ing and debugging line by line in front of a monitor and of course i appreciate their work.
but
there are many thing beside making money that matters.
(this is my campaign slogan when I'm running for the office!)
so excited to test your suggestions one by one.
from now onxxvirusxx wrote: ↑Thu Aug 22, 2019 1:36 amYou can remove this from catalog/controller/product/product.php (line 212)
Code: Select all
$data['breadcrumbs'][] = array( 'text' => $product_info['name'], 'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']) );
i have a different mindset about a "VIRUS".
thanks a lot.
Code: Select all
$data['breadcrumbs'][] = array(
'text' => mb_substr($product_info['name'], 0, strrpos(mb_substr($product_info['name'], 0, 60), ' ' )).'...',
'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id'])
);
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
viewtopic.php?f=183&t=217081
OCMod Installation
Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing
Users browsing this forum: Baidu [Spider] and 407 guests