Next/Previous restricted by category?
Posted: 12 August 2004 09:50 PM   [ Ignore ]  
Summer Student
Total Posts:  17
Joined  05-16-2004

Hello: I am building a site where it would be very advantageous to have the Next/Previous linking ability restricted to specific categories. Is this possible in a future release?

Thanks,

Estelle

Profile
 
 
Posted: 13 August 2004 06:46 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  74
Joined  05-14-2004

I like that idea too.

Profile
 
 
Posted: 05 December 2004 05:23 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  249
Joined  11-04-2002

Would love to see this as well! Actually, there are several things I’d like to see added to the Next/Previous tags, including restricting by category, and the same orderby and sort flexibility as in the main weblog entries tag. smile

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 06 December 2004 08:21 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  863
Joined  04-17-2002

I would also love this. Also pagination within category would be handy.

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
Posted: 04 April 2005 01:50 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  742
Joined  05-16-2004

Any ideas about how to achieve this effect, with PHP or other workarounds, would be greatly appreciated.

 Signature 

Check out our add-ons for EE:

* Hop Inject * * Deeploy Helper * * Edit This * * Publish Improve * * Reeveal Comments *


Hop Studios Internet Consulting
http://www.hopstudios.com/
yes, I used to be “supersusie” smile

Profile
 
 
Posted: 02 September 2005 05:00 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  96
Joined  08-31-2005

i’d like this.

Profile
 
 
Posted: 11 December 2005 09:18 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1655
Joined  05-15-2004

Seconding this one too. Next/Previous needs to be able to take category tags, orderby, etc, to be really useful in a non-blog situation.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 23 January 2006 10:04 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
RankRank
Total Posts:  213
Joined  10-21-2004

Thirding, fourthing and fifthing this one. An addition to the next/prev tags for single entry pages would be cool. I’m taking the syntax from the ‘entry_linker’ plugin for gallery entries:

{exp:weblog:next_entry categories=“on”}

Next entry: {title}

{/exp:weblog:next_entry}

Profile
 
 
Posted: 25 January 2006 05:51 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
RankRank
Total Posts:  213
Joined  10-21-2004

We did a modification to mod.weblog.php to effect this change in behaviour.

The usage becomes:

{exp:weblog:next_entry restrict_category="yes"}
<p>Next entry: <a href="{path="news/comments"}">{title}</a></p>
{/exp:weblog:next_entry}

{exp
:weblog:prev_entry restrict_category="yes"}
<p>Previous entry: <a href="{path="news/comments"}">{title}</a></p>
{/exp:weblog:prev_entry}

This is the diff patch:

*** mod.weblog.php2006-01-24 12:08:27.000000000 +0000
--- mod.weblog.php.ORIG2006-01-23 16:40:01.000000000 +0000
***************
***
4652,4670 ****
  
{
  $qstring
= $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
  
}
-
-
$CAT_FROM="";
-
$CAT_WHERE="";
-
-         if (
$TMPL->fetch_param('restrict_category') == "yes") {
- $CAT_FROM=", exp_category_posts AS c1, exp_category_posts AS c2";
-
$CAT_WHERE="AND t1.entry_id = c1.entry_id AND t2.entry_id = c2.entry_id AND c1.cat_id = c2.cat_id";
-
}
                          
          $sql
= "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs $CAT_FROM
! WHERE t1.weblog_id = exp_weblogs.weblog_id $CAT_WHERE"
;
!
          
          if (
is_numeric($qstring))
          
{
--- 4652,4661 ----
  
{
  $qstring
= $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
  
}
                          
          $sql
= "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs
! WHERE t1.weblog_id = exp_weblogs.weblog_id "
;
          
          if (
is_numeric($qstring))
          
{
***************
***
4790,4807 ****
  
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
  
}
          
! $CAT_FROM="";
!
$CAT_WHERE="";
!
!         if (
$TMPL->fetch_param('restrict_category') == "yes") {
! $CAT_FROM=", exp_category_posts AS c1, exp_category_posts AS c2";
!
$CAT_WHERE="AND t1.entry_id = c1.entry_id AND t2.entry_id = c2.entry_id AND c1.cat_id = c2.cat_id";
!
}
!                         
!         
$sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs $CAT_FROM
! WHERE t1.weblog_id = exp_weblogs.weblog_id $CAT_WHERE"
;
!
          
          if (
is_numeric($qstring))
          
{
--- 4781,4789 ----
  
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
  
}
          
!         $sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs
! WHERE t1.weblog_id = exp_weblogs.weblog_id "
;
          
          if (
is_numeric($qstring))
          
{
***************
***
5384,5387 ****
        
  
}
  
// END CLASS
! ?>
--- 5366,5369 ----
        
  
}
  
// END CLASS
! ?>
\ No newline at end of file
Profile
 
 
Posted: 25 January 2006 05:51 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
RankRank
Total Posts:  213
Joined  10-21-2004

Excuse the darn smilies in there.

Profile
 
 
Posted: 25 January 2006 05:59 AM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40151
Joined  05-14-2004

Edited your post to add code tags so that the smileys don’t come up.  [ code ] code [ /code ] (no spaces, obviously) for future reference. =)

 Signature 
Profile
MSG
 
 
Posted: 25 January 2006 06:01 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
RankRank
Total Posts:  213
Joined  10-21-2004

Cool! Thanks. smile

Profile
 
 
Posted: 01 February 2006 12:47 PM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  96
Joined  08-31-2005

i’d like this functionality please and thank you.

Profile
 
 
Posted: 23 February 2006 06:01 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRank
Total Posts:  5079
Joined  03-22-2004

This would be fantastic and save a lot of headache thanks

 Signature 
Profile
 
 
Posted: 24 August 2006 05:19 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  06-03-2003

Adding a bump to this Feature Request as well. Can’t use the Next/Prev Entry link unless we can specify by Category.

 Signature 

Shane Robinson - twitter.com/shane

http://www.barefeetstudios.com
http://www.beachwalks.tv
http://reef.beachwalks.tv

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 02:47 PM
Total Registered Members: 119234 Total Logged-in Users: 91
Total Topics: 125532 Total Anonymous Users: 63
Total Replies: 660793 Total Guests: 438
Total Posts: 786325    
Members ( View Memberlist )