Giorgi625 VIP
Total posts: 655
28 Feb 2017 17:57

Hello,

How can I change rating template? I know that it is located in directori /components/com_cobalt/views/rating_tmpls, but there I see php and xml files, I am able to edit amount of stars but I don't know how to remove text(0% from 0 rating) after star.

I found that this text is called in this file components/com_cobalt/library/php/helpers/rating.php and I can just delete its code, but problem is that I want to hide this text on records list view but in full record view I want to show this text.

Or another option is to display this text in tooltip for hover action, but I don't understand how to do it because for me this template has complicated structure.

Can anyone give me any suggestions?

Last Modified: 01 Mar 2017


pepperstreet VIP
Total posts: 3,837
28 Feb 2017 21:24

Giorgi625 I want to hide this text on records list view but in full record view I want to show this text.

Hello Giorgi625, you might hide it with a specific CSS rule.
The default HTML markup for all those lines seem to be:

<small id="rating-text-XXXX">0% of 0 votes</small>

Where XXXX is the record ID. To hide ALL occurrences you could use the following CSS rule:

small[id^="rating-text"] {
    display: none;
}

To stay in list context, you could simply add the line in:
- your Section's Markup layout template -> Custom CSS parameter

cob_sec_template_markup_layout_custom_css


If you already have other customizations and files, you might also use:

  • OR in list template external CSS file
  • OR in your Joomla template custom.css (this would require an additional class before that rule. class from body/page or your section list container)

Hope this helps.


Giorgi625 VIP
Total posts: 655
28 Feb 2017 21:30

I just added this css code into tempaltes php files style tags and it worked thanks.


Sergey
Total posts: 13,748
01 Mar 2017 07:15

I have completely forgot about markup template parameter to insert CSS. That was nice hit Paperstreet!


pepperstreet VIP
Total posts: 3,837
01 Mar 2017 21:00

Sergey I have completely forgot about markup template parameter to insert CSS. That was nice hit Paperstreet!

Yeah ;) Almost forgot about it, too. Actually a nice and quick way for smaller customizations per section.
No struggle with CSS specificity. Although, a bit risky if template settings get lost or messed up.

Powered by Cobalt