By neotechie on
Hi,
I am quite confused on how do I solve below problem -
I have some nodes bookmarked by a user of type A. Those nodes are being referred by another set of nodes of type B. I need to display the titles of the set of nodes of type B referring all the nodes of type A bookmarked bye a particular user when he/she logged-in (in a block).
Please help. I don't know how to achieve this.
Regards and lots of thanks!
Neotechie
Comments
i dont think there is a way
i dont think there is a way with core modules or views. For sure it can be done with a custom query including some JOIN statements. If nobody has a better idea i could try to point out a direction.
What modules are you using for the bookmarking?
----------------------
okay.cool
Views Bookmark
Hi,
Thank you very much for your reply.
I am using Views Bookmark http://drupal.org/project/views_bookmark . I am in fact open to use any other bookmark module if needed (click2bookmark). Pleas let me know. Your help is greatly appreciated.
Regards.
ohh... i never worked with
ohh... i never worked with that module... i would have to try it out...
anybody with ideas???
----------------------
okay.cool
Thanks
I'll wait for your suggestion. No-one seems to be interested in this problem!
Neotechie
direction
i guess there will be a lot of room for improvement, but this worked in a fast test i did. I quickly installed the module and made some references between some node types. You just stick that code in a new block with PHP Filter enabled.
I tested like this.
bookmarked node1 -----referenceTo-----> mainnode1
bookmarked node2 -----referenceTo-----> mainnode2
THIS ONLY WORKS IF YOUR REFERENCE FIELD IS ONLY USED IN ONE NODETYPE. If you reuse the field it doesnt get stored in the content_type_YOURTYPE table, but in its own.
ALSO NOTICE that you have to rename field_reference_nid TO field_YourFieldname_nid (you can look that up in the database if your not sure)
the problem is, its hard to make a gereric approach. There are many small details that may require a totally different approach. Hope this helps.
----------------------
okay.cool
Thanks!!!!!!!!!!!!!!!!
A big thanks Jochen Meyer!!
I will test this and come back. But I think I did not explain the problem correctly. What I am trying to do is below -
node1 -----referenceTo-----> bookmarked mainnode1
node2 -----referenceTo-----> bookmarked mainnode2
Displaying node1 & node2 and others which are referencing mainnodes.
As now you have directed me I will try and see I I can use your code and solve the problem.
Thanks Again!
I get an error
Hi,
While using the above code I get the below error. I am not sure why. Please help.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nid), FROM views_bookmark_nodes WHERE uid = 1' at line 1 query: SELECT DISTINCT(1.nid), FROM views_bookmark_nodes WHERE uid = 1 in C:\wamp\www\drupal-5.2V2\includes\database.mysql.inc on line 172.
Thanks,
Piyush
no clue... the bookmark
no clue... the bookmark views module is installed?
----------------------
okay.cool
yes
yes it is installed.
making data queries from multiple tables.
I have had a similar kind of problem. Made this post and haven't got any replies.
It seems that Drupal have some problems when it comes to organizing content in relative databases. The node-reference field in CCK only refers to the Title.
I have tried a little with Views fusion (requires -Node Family-) I think it might solve your problem.
Not mine unfortunately.
same problem here
I have a similar problem, the node-reference field in cck only refers to the title, in my case, i need a reference to a date so I can filter using a view. made a post but no reply.
if you find a solution to the node-reference not refering to the title please post link here..
Luis
Luis