I have a seemingly complex programming challenge in my first-ever Revo site. I have read the pertinent sections of the manual and also Bob Ray’s excellent material on MODx objects at
http://bobsguides.com/revolution-objects.html. I have also researched getResources.
Here is an example illustrating my situation. I am cataloging books, with one MODx resource representing one book (probably not the best way to go about a large catalog, I know - but my actual project is less extensive). I have added a custom TV for "author". Here is an abbreviated look at the data in my resources so far:
book_title | tv_author |
Hamlet | William Shakespeare |
Richard II | William Shakespeare |
Ivanhoe | Sir Walter Scott |
David Copperfield | Charles Dickens |
In addition, I have a custom table - let’s call it modx_authors - where more information about each author is stored:
author | birth_year | death_year |
William Shakespeare | 1564 | 1616 |
Sir Walter Scott | 1771 | 1832 |
Charles Dickens | 1812 | 1870 |
And finally, a snippet, book_browser, which is to display the catalog tables alluded to in the subject of this post. It is to look something like this:
Group books by: Century of author’s birth
1500’s
Hamlet | William Shakespeare |
Richard II | William Shakespeare |
1700’s
Ivanhoe | Sir Walter Scott |
1800’s
David Copperfield | Charles Dickens |
With each group being its own table. Thus, we are grouping the books by comparing TV’s to external data. As far as I know, there is no way to accomplish this with getResources (please correct me if I’m wrong) - at least not entirely.
I think the question boils down to this: How can I select MODx objects based on a comparison of their TV’s to an external table?
Then again, perhaps I’m totally on the wrong track and someone can help me see that the question is something totally different
Thanks for bearing with me through this long post. Any help, suggestions, or opinions would be greatly appreciated!