- Posts: 109
COMMUNITY FORUM
Rating for tag.php
- Franz Heine
- Topic Author
- Offline
- Premium Member
Less
More
10 years 9 months ago #122048
by Franz Heine
Rating for tag.php was created by Franz Heine
Hi,
is it possible you use the rating for the tag.php ?
Ive tried:
<?php if($item->params->get('catItemRating')): ?>
<!-- Item Rating -->
<div class="catItemRatingBlock">
<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
<div class="itemRatingForm">
<ul class="itemRatingList">
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $item->id; ?>" style="width:<?php echo $item->votingPercentage; ?>%;"></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
</ul>
<div id="itemRatingLog<?php echo $item->id; ?>" class="itemRatingLog"><?php echo $item->numOfvotes; ?></div>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
<?php endif; ?>
Now i see the rating, and can rate the articles, but if i refresh the site. All ratings are gone (for example: 3 persons already rate this item )
I copied the rating code from category_item.php. Ive changed $this->item->params->get into $item->params->get
Could the parameter "$this" be the problem ?
Thx
Franz
is it possible you use the rating for the tag.php ?
Ive tried:
<?php if($item->params->get('catItemRating')): ?>
<!-- Item Rating -->
<div class="catItemRatingBlock">
<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
<div class="itemRatingForm">
<ul class="itemRatingList">
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $item->id; ?>" style="width:<?php echo $item->votingPercentage; ?>%;"></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
<li><a href="#" rel="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
</ul>
<div id="itemRatingLog<?php echo $item->id; ?>" class="itemRatingLog"><?php echo $item->numOfvotes; ?></div>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
<?php endif; ?>
Now i see the rating, and can rate the articles, but if i refresh the site. All ratings are gone (for example: 3 persons already rate this item )
I copied the rating code from category_item.php. Ive changed $this->item->params->get into $item->params->get
Could the parameter "$this" be the problem ?
Thx
Franz
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #122049
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Rating for tag.php
Actually you should try the snippet without the <?php if($item->params->get('catItemRating')): ?> since there is no setting (param) for rating in that view.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Franz Heine
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 109
10 years 9 months ago #122050
by Franz Heine
Replied by Franz Heine on topic Re: Rating for tag.php
Hi Krikor,
thx for the advice. It works.
But ive still one problem. Generally you can see the stars in the category view, if rated.
In my "tag" view i cannot see the stars, just after rating i can see the stars and the votes. Buf if i refresh the site again, everything is gone
I think its a problem with this part of the code:
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $item->id; ?>" style="width:<?php echo $item->votingPercentage; ?>%;"></li>
Hope you have another good advice krikor.
If you want to check the site: www.ratenkauf-24.de/computer-ratenzahlung.html
thx for the advice. It works.
But ive still one problem. Generally you can see the stars in the category view, if rated.
In my "tag" view i cannot see the stars, just after rating i can see the stars and the votes. Buf if i refresh the site again, everything is gone
I think its a problem with this part of the code:
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $item->id; ?>" style="width:<?php echo $item->votingPercentage; ?>%;"></li>
Hope you have another good advice krikor.
If you want to check the site: www.ratenkauf-24.de/computer-ratenzahlung.html
Please Log in or Create an account to join the conversation.