Needs review
Project:
Node Relativity
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Oct 2007 at 20:55 UTC
Updated:
22 Jul 2010 at 19:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
Daryljames commentedHave you figured this out yet? I need the same functionality.
Comment #2
mshaver commentedI ended up using the viewsfield module with arguments. Both Node Relativity and Views Fusion were not working for me? The viewsfield module works pretty will, but you have to set the child nodes up with a nodereference to the parent. Then you can use arguments to display only those children with the nid of the parent.
Comment #3
rsmith5 commentedHere is a patch that implements this functionality. To use, edit your table view and add the "Relativity: Child Title" field. This patch has been working for me, but is still an alpha version, so be sure to test before using on a production site.
Comment #4
Daryljames commentedAwesome...
Thanks for the patch it seems to be working just fine at this point... Wow it's like christmas come early...
This is exactly what I needed...
I really appreciate the post... thanks....
Daryl
Comment #5
Daryljames commentedI'm trying to figure out how to limit the # of children titles that appear in the table view, is there a way to do that?
Preferably the most recent 1-3 that were created...
I'll look into the code.
Daryl
Comment #6
rsmith5 commentedYou can accomplish this by replacing the line:
$result = db_query("SELECT rel.nid, n.title FROM {relativity} rel INNER JOIN {node} n ON rel.nid = n.nid WHERE rel.parent_nid = %d ORDER BY n.title ASC", $data->nid);with:
$result = db_query("SELECT rel.nid, n.title FROM {relativity} rel INNER JOIN {node} n ON rel.nid = n.nid WHERE rel.parent_nid = %d ORDER BY n.created DESC LIMIT 3", $data->nid);Additionally, if you want to sort based on the modification date rather than the created date replace
ORDER BY n.created DESCwithORDER BY n.changed DESCYou can also change how many are displayed with the
LIMIT 3argument.Hope that helps!
Comment #7
jgoldfeder commentedGreat! I was just about to code this exact thing. Thanks!
I can confirm it works for 5.x-2.x-dev (except don't try to sort children inside views). Thanks also for the extra effort getting pathauto compatibility in there too.
Comment #8
Daryljames commentedAwesome, thanks for the help, I'm kinda new to coding.... It works great.
Comment #9
summit commentedSubscribing. Greetings, Martijn
Comment #10
heydere commentedSubscribing.
Comment #11
xjmTracking.
Comment #12
socialnicheguru commentedsubscribing
Comment #13
troym559 commentedHello, Would this also work for version 5.x-2.4? I would like to try this.
Comment #14
rsmith5 commentedIt should, I have been using this patch on updated versions of relativity.
Comment #15
tomhung commentedWill this patch be included in the D5 release???
Comment #16
xjm@15: I'd say it's unlikely at this point. Drupal 5 support is coming to an end and most maintainers are fixing critical bugs only in D5 modules.
Comment #17
chien_fu commentedI've never added a patch before, I'm assuming that you tack that code onto the end of the .module file?
Thanks.
Okay, that didn't work... Can someone tell me where specifically I should add this code to the module files?
Does that SQL query get me to the same place? And if so, where would one add that? I don't see a line like the one described.
Comment #18
xjm#17: http://drupal.org/patch/apply