Next/Previous restricted by category?
Posted: 12 August 2004 10: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 07:46 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  74
Joined  05-14-2004

I like that idea too.

Profile
 
 
Posted: 05 December 2004 06: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 09: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 02:50 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  743
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 06:00 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  96
Joined  08-31-2005

i’d like this.

Profile
 
 
Posted: 11 December 2005 10:18 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1658
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 11: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 06: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 06: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 06:59 AM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40192
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 07:01 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
RankRank
Total Posts:  213
Joined  10-21-2004

Cool! Thanks. smile

Profile
 
 
Posted: 01 February 2006 01: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 07:01 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRank
Total Posts:  5168
Joined  03-22-2004

This would be fantastic and save a lot of headache thanks

 Signature 
Profile
 
 
Posted: 24 August 2006 06:19 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  06-04-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 03:47 PM
Total Registered Members: 120130 Total Logged-in Users: 77
Total Topics: 126275 Total Anonymous Users: 42
Total Replies: 664122 Total Guests: 328
Total Posts: 790397    
Members ( View Memberlist )