rating pagination / link back to original entry
Posted: 15 April 2008 07:23 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  40
Joined  2008-04-04

Hi.

I have two queries regarding a simple listing of all entries which have been rated:

1. I am unable to get the page which lists all entries which have been rated to ‘paginate’ e.g. limit number shown to 15, then click for next 15
2. Also, although my current listing ‘works’ except for 1. above, the link back to the original entry doesn’t i.e. if ...

<a href="{title_permalink=keynotes_central/comments}">{title}</a>

... doesn’t work, what does?

The code being employed is ...

- - - - -

<div class="hp_entries_list">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
{exp:rating:entries weblog="weblogname" orderby_ratings="date" sort="desc" limit="15" dynamic="off" backspace="6"}
<tr>
<td width="99%" valign="top"><div class="hp_entries_items" onmouseover="this.style.backgroundColor=’#F5F5F5’; “onmouseout="this.style.backgroundColor=’#FFFFFF‘“>http://www.domainname.com/weblogname/kc_img/arrowS_orange.gif {title}</div>
<div class="summary_listall">{stars}{rating}{/stars}</div>
<div class="summary_listall">{review}</div>
<div class="posted_by">Posted by <span class="orange">{rating_name}</span> on {rating_date format="%d/%m/%y"} at {rating_date format=’%h:%i%a’} GMT+1

</div>
</td>
<td width="1%" valign="top"><div align="right" class="hp_entries_list_date">{rating_date format=’%d/%m/%y’}</div></td>
</tr>
<tr>
<td valign="top">{paginate}
<div align="left" class="pagecount_L_coms"><div class="paginate_read_more_coms">Page {current_page} of {total_pages} pages</div>
<div align="right" class="pagecount_R_coms">{pagination_links}</div></div>
{/paginate}{/exp:rating:entries}</td>
<td valign="top"> </td>
</tr>
</table>
</div>

- - - - -

What am I missing?

Thanks in advance.

Profile
 
 
Posted: 15 April 2008 08:30 AM   [ Ignore ]   [ # 1 ]
Jr. Member
RankRank
Total Posts:  40
Joined  2008-04-04

By fiddling with the order of the tags (and introducing a new set), I have now been able to link back correctly to the original entry. The working code I now have is:

- - - - -

<div class="hp_entries_list">
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
{exp:rating:entries weblog="weblogname" orderby_ratings="date" limit="5" dynamic="off" backspace="6"}
{exp
:weblog:entries weblog="weblogname" entry_id="{entry_id}"}
<tr>
<
td width="99%" valign="top"><div class="hp_entries_items" onmouseover="this.style.backgroundColor='#F5F5F5';
"
onmouseout="this.style.backgroundColor='#FFFFFF'"><img src="http://www.domainname.com/weblogname/kc_img/arrowS_orange.gif" width="3" height="7" /> <a href="{title_permalink=keynotes_central/comments}">{title}</a></div>
<
div class="summary_listall">{stars}{rating}{/stars}</div>
<
div class="summary_listall">{review}</div>
<
div class="rating_by">Posted by <span class="orange">{rating_name}</span> on {rating_date format="%d/%m/%y"} at {rating_date format='%h:%i%a'} GMT+1<br />
<
br /></div>
</
td>
<
td width="1%" valign="top"><div align="right" class="hp_entries_list_date">{rating_date format='%d/%m/%y'}</div></td>
</
tr>
<
tr>
<
td valign="top">{paginate}
<div align="left" class="pagecount_L_coms"><div class="paginate_read_more_coms">Page {current_page} of {total_pages} pages</div>
<
div align="right" class="pagecount_R_coms">{pagination_links}</div></div>
{/paginate}{/exp:weblog:entries}{/exp:rating:entries}</td>
<
td valign="top">&nbsp;</td>
</
tr>
</
table>
</
div>

- - - - -

Still having a problem with the pagination though, so advice still welcome.

KCesp.

Profile
 
 
Posted: 22 April 2008 06:21 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2007-06-28

I had to do this same type of setup.  It seems incredibly inefficient. 

Solspace guys- I know you are busy as hell but just a confirmation that this is your recommended method would be nice.

Profile
 
 
Posted: 23 April 2008 06:57 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2747
Joined  2006-10-18

KCesp,

The Pagination will collide with the Weblog:Entries loop.

Try pulling the Pagination between the Weblog:Entries Close and the Rating:Entries Close:

<td valign="top">{/exp:weblog:entries}{paginate}
<div align="left" class="pagecount_L_coms"><div class="paginate_read_more_coms">Page {current_page} of {total_pages} pages</div>
<
div align="right" class="pagecount_R_coms">{pagination_links}</div></div>
{/paginate}{/exp:rating:entries}</td>
<
td valign="top">&nbsp;</td>
</
tr>
</
table>
</
div>

Secondly, an alternative method we always suggest is to use Embeds.
eyevariety, I know this may sound clunky, but you have to remember that a lot of variables are shared, so they easily collide.

Using a simple embed like this should also work:

Main Template Code:

<div class="hp_entries_list">
<
table width="100%" border="0" cellspacing="0" cellpadding="0">
{exp:rating:entries weblog="weblogname" orderby_ratings="date" limit="5" dynamic="off" backspace="6"}
{embed
="path_to/weblog_entries_embed" entryid="{entry_id}"}
{paginate}
<div align="left" class="pagecount_L_coms"><div class="paginate_read_more_coms">Page {current_page} of {total_pages} pages</div>
<
div align="right" class="pagecount_R_coms">{pagination_links}</div></div>
{/paginate}{/exp:rating:entries}</td>
<
td valign="top">&nbsp;</td>
</
tr>
</
table>
</
div>

Embedded Template Code:

{exp:weblog:entries weblog="weblogname" entry_id="{embed:entryid}"}
<tr>
<
td width="99%" valign="top"><div class="hp_entries_items" onmouseover="this.style.backgroundColor='#F5F5F5';
"
onmouseout="this.style.backgroundColor='#FFFFFF'"><img src="http://www.domainname.com/weblogname/kc_img/arrowS_orange.gif" width="3" height="7" /> <a href="{title_permalink=keynotes_central/comments}">{title}</a></div>
<
div class="summary_listall">{stars}{rating}{/stars}</div>
<
div class="summary_listall">{review}</div>
<
div class="rating_by">Posted by <span class="orange">{rating_name}</span> on {rating_date format="%d/%m/%y"} at {rating_date format='%h:%i%a'} GMT+1<br />
<
br /></div>
</
td>
<
td width="1%" valign="top"><div align="right" class="hp_entries_list_date">{rating_date format='%d/%m/%y'}</div></td>
</
tr>
<
tr>
<
td valign="top">{/exp:weblog:entries}

Also, note how the Entry ID is being passed smile

 Signature 
Profile