switchblade1984 VIP
Total posts: 132
07 Авг 2012 22:15

I want to make an all Tabbed look to an article but the Ratings are out-of-place. In Resources you had fields for ratings which helped style the site for ways like this.

basically I want the ratings to appear in one of my Tabbed Groups, not on the outside. Is there a way to do this?

Последние изменения: 02 Март 2014


pepperstreet VIP
Total posts: 3,837
08 Авг 2012 02:04

Not sure, but the current integrated rating has to be "placed" and "styled" in a custom template. Sorry, had no time to play with it in detail, yet. But you are right, an extra field plugin makes still sense.

BTW, rating field is/was in heavy discussion ;-)

http://support.mightyextensions.com/en/mighty-resources-cck-joomla-component/ideas/Completed +Review+and+Rating+system+in+Resources+6G-1148.html

http://support.mintjoomla.com/en/cobalt-7/ideas/Rating +-+author+and+users+average-1446.html


Sergey
Total posts: 13,748
08 Авг 2012 03:05

The rating in template is simple

echo $item->rating

You can move it anywhere you want. But I afraid this will require custom template. No option for opt of the box solution.


Sackgesicht VIP
Total posts: 1,636
08 Авг 2012 07:47

Ken,

in the Cobalt backend, go to Templates--> Article and copy the default template to a new name (example "rating").

Between Line 185 and Line 186 insert following lines:

            <?php if ($group_name =='XXX') {

                group_start($this, 'Rating Tabber', 'group'.@$i++);

                echo $this->item->rating;

                group_end($this);

            } ?>

so that you have something like this:



<?php group_end($this);?> <?php if ($group_name =='XXX') { group_start($this, 'Rating Tabber', 'group'.@$i++); echo $this->item->rating; group_end($this); } ?> <?php endforeach;?>

Replace the XXX with the name of the Tabber element after which the Rating-Tab should appear.

Rename the label of your Rating tabber to your liking.

Delete line 136 - 138

    <?php if($this->item->rating && $params->get('tmpl_core.item_rating')):?>

        <?php echo $this->item->rating;?>

    <?php endif;?>

This is just a quick example, you can refine it with the rating parameter settings etc.

Hope it helps a bit.....


Sackgesicht VIP
Total posts: 1,636
08 Авг 2012 07:55

The last PHP code block was modified by the PHP formatter (inserted the smile class). It should read:

<?php if($this->item->rating && $params->get('tmpl_core.item_rating') ) :?>

    <?php echo $this->item->rating;?>

<?php endif;?>

Sergey
Total posts: 13,748
08 Авг 2012 08:00

тв last version is enable use HTML in titles. So it have to be much easier.


switchblade1984 VIP
Total posts: 132
09 Авг 2012 00:22

Also I am looking to change the Multi-Ratings Word "General" to something else like, "Total" Or "Total Rating" I looked everywhere in the Cobalt folder but couldnt find it in any of the files, can you point me in the right direction?


switchblade1984 VIP
Total posts: 132
09 Авг 2012 02:20

Thank you very much! I will keep my eye out if I see it change anything else but it looks good so far.


Sergey
Total posts: 13,748
09 Авг 2012 03:36

But if you do not want to miss your changes on update you need to create language override.

add file

/components/com_cobalt/language/en-GB/en-GB.com_cobalt.ini

And add all changes there. So you do not lose it on update.

Работает на Cobalt