Am I correct that you have an MP3 weblog with a relationship field for the speaker, and you are also categorizing the MP3 weblog entries? Can you give me a non-code example of the output you are desiring?
Ok, so what you have here is category archives output, but are wanting it within the reverse relationship for each entry. You’re going to need either some PHP or be willing to use some embedded templates and some increased overhead. The whole bit about displaying entries sorted under category headings is the “expensive” part I speak about in the article, and doing this inside of each entry only compounds that. You’re no longer doing one or the other, but both. I’d recommend taking what you’ve gotten so far, and heading over to the How To forums with it to seek some assistance on different ways you could build that type of output.
Just wanted to say that relationships and reverse relationships are the reason why I bought EE for my personal site. Now I was able to transform my site from a structured article-site to a full-size imdb.com-like website and lifted EE from a blogging tool to something even more powerful than a regular CMS. I just love those relationships!
(I must say, the database size looks huge if you use a bunch of (reverse)relationships, but if you optimize your databases once in a while you solve that problem as well.)
Another good & useful article - thanks. How I wish reverse_relationships had been available in EEv1.4!
Some thing that is a bit counter-intuitive on casual reading is the child-parent terminology. Thus in your example, a ‘feature’ is the parent to a ‘feature_category’ and 1 child could have 10, 20 or even 10000 parents!!
<old man voice> I guess I’m just not used to this modern era. In my day, a child had one or two parents and that was it.</old man voice>
BTW what happens if the child is pointed to by related entry fields in two different weblogs? Since there is no id in the reverse_related, how would do you select the weblog you want to use?
But perhaps this is a rather hypothetical question, that is not likely to occur in practice?
You would supply a weblog= parameter to the {reverse_related_entries} tag pair; if you do not, then it will show all entries from all weblogs that have been related to said entry.
Back to the original topic, I am buidling something very similiar on a site right now, however what can be done to hide the headings (or in this case feature categories) if there are no reverse related entries?
The information from the weblog entries tag cannot natively be hidden or acted on based on whether the entry has been related to other entries. Some PHP either in the template, or setup as a plugin could handle that though; I’d step over to the How To forum and ask for assistance if your comfortability with PHP is low.
I just came back to this article as I knew it would come in handy for a future site and I think it has done.
The count variable is an awesome find! It took me a little while to see what was going on but I think it’s one for the assets drawer.
One thing I really like are practical examples of EE features as I can see them applied to real life situations. Of course it would be wonderful to see all the docs in this way but thank you Derek for taking the time to show us how the developers think when using EE.
I’m very much looking forward to the next installment!
Derek, just wondering if there was any reason why the EE Knoweldge Base was built using Categories instead of this Reverse Entries method?
cheers Kenny
Derek, just wondering if there was any reason why the EE Knoweldge Base was built using Categories instead of this Reverse Entries method?
cheers Kenny
It required multiple levels of categories, i.e. sub-categories, and nesting isn’t possible with reverse related entries, at least, not efficiently.