Not sure if this is the best way to go about this, but I was trying to get the tid that was created from the node available as a field in node views, and the nid of the node that created the term available as a field in term views.
I also took out the nid from node views since the node base table already provides nid, and tid from term views since term_data already provides tid for those.
The nice thing about this is that you can now create term views with a field that links to the node that created it, or a node view where a field links to the term it created.
Comments
Comment #1
Zen commentedComment #2
marcvangendExcellent patch, I needed this, thank you q0rban! I haven't found any bugs so far, if I do, I'll let you know.
Comment #3
anantagati commentedAttached patch seems to remove support for arguments.
I am closing this issue as there was recently committed patch #624640: Add a views relationship to the NAT node to 6.x-1.x-dev. It enables you to use NAT relationship and thus be able to access NAT node data in view.
Comment #4
hawleyal commentedI can't see the NAT TID or NAT NID relationships, arguments, or fields in a terms view (items of type Term).
There's not even a NAT group.
Am I missing something?
Comment #5
anantagati commentedDid you installed latest dev version?
If you have problem, please open new support issue.
Comment #6
hawleyal commentedSpecifically.
I have a generic term view.
They query is:
SELECT term_data.tid AS tid, term_data.name AS term_data_name, term_data.vid AS term_data_vid FROM term_data term_dataI'd like to add the NAT NID to the query:
SELECT term_data.tid AS tid, term_data.name AS term_data_name, term_data.vid, nat.nid as nat_nid FROM term_data term_data LEFT JOIN nat nat ON term_data.tid = nat.tidThoughts?
Comment #7
hawleyal commentedyes, latest dev version.
I'm staring at the code.
All join on node, none on term.
Shouldn't it be join on term_data, table nat, left field tid right field tid, result field nid?
Comment #8
anantagati commentedIf you can post patch, I can look at it and commit it.
Comment #9
hawleyal commentedgeez.
never developed a mod.
don't know the docs on api structure.
i suppose i could break my own site without too much trouble.
anything special i need to know about editing nat.views.inc?
Just edit, upload, use?
Flush caches?
Run update?
Comment #10
anantagati commentedOf course you don't play with live site.
Comment #11
hawleyal commentedwell, not production yet.
still just R&D.
Comment #12
hawleyal commentedOkay. Guess it was simpler than i thought.
Here's the code.
Patch attached.
Comment #13
anantagati commentedThank you for the patch. Committed in 6.x-1.x-dev.
Comment #15
drewvancamp commentedI'm beating my head trying to provide a field in my view that represents the NAT-related term for each listed NAT-related node. This is a node view because I'm pulling in CCK from a NAT-created term's associated node. The only term-related field I need is the path to the term page so I can make the node content navigate the user to the NAT term's page (rather than than the NAT node).
What I'm working with is a hierarchy of NAT nodes/terms (a product catalog), e.g. Apparel > Ladies Apparel > Ladies Vests > Ladies Premium Vests. On each term page, which is overridden using Panels and Views, I'm showing several views. One displays content from the NAT node that belongs to the term we're looking at. Another shows all products associated with the viewed term. The tough one involves showing all subcategories of the category we're looking at which works fine and basically pulls up all nodes that are associated with the current term (using an argument) as their parent term (using a relationship); this gives me the child categories related to the current term. However, I want these child categories to link directly to the associated term page, but the only fields I seem to be able to produce are links either to the NAT-related node or the parent term. I don't see how to display the NAT-created TID related to the NID that's listing by way of views.
The aforementioned use of NAT relationships only seems to provide me with the NID for the currently viewed term. Instead I'm trying to show the TID for the child nodes of the current term. And my head is spinning as a result...
Could I be missing something obvious or perhaps just going about this the wrong way?
(Please don't bother advising the use of Ubercart or any other catalog-related module. I'm sticking to Views-Panels-Taxonomy-CCK solutions to maximize compatibility with other modules and to give myself complete control and customization over the catalog pages.)
Hope someone will be able to help me. I've tried to find tutorials and NAT-Views documentation and I've looked through similar discussions and issues (this has been about as difficult as it was for me to catch on to the use of Views arguments and relationships).
Thank you for your time,
- Drew