Say you’re building a comprehensive site for a large church, where each ministry has activities, each activity holds events, and photos are taken at each event. You have a weblog each for ministries, activities, events and photos. Photos have a relationship field linking to events, events to activities, and activities to ministries. You don’t want to enter redundant data, relating the photos to the ministry, because the system should already know that. But how does it? On the ministry homepage, how do you display the five latest photos from across that ministry’s events?
With difficulty, I learned was the answer. It requires either a series of embedded templates or a long SQL query in your template. But now with the Tied Entries plugin it’s easy – you can span the relationships and reverse relationships among fields and weblogs every which way using EE-style tags:
{exp:weblog:entries weblog="ministries"}
{exp:tied_entries entry_id="{entry_id}" tie="<activities<events<photos" limit="5" orderby="entry_date" sort="desc"}
{site_url}photos/{tied:photos_filename}
{/exp:tied_entries}
{/exp:weblog:entries}See the docs for more details and another simple example with bands, albums and songs.
Tied Entries hasn’t yet been tested against any add-ons, but once there’s a demand for that I’ll get on it.
The license per commercial site costs $20, per personal site $7.50, and it’s free to download and try (requires registering at the Engaging.net site).
First ten downloaders get their first license free!
Update a few hours later: That’s it, the first ten have registered to download, once wuerml and eddiet confirm their emails.
Update 2009 Nov 17: Now ported to EEv2.
Hi Adam,
The plugin sounds really interesting. Would be great to give this one a go but I just registered on your site and then checked my e-mail and haven’t received the activation code as of yet.
Just wondering if I’m one of the first 10 downloaders though? 😉
Looking forward to giving this one a go though.
Best wishes,
Mark
Mark, thanks for trying it. Registration should work – I’m getting the emails when test registering – but maybe email from my server is being blocked by yours. At any rate, I’ve activated your member account. You’re not only among the first ten, you’re the first!
Hi Adam,
Thanks. Just got the e-mail now and have downloaded the file. Will give this a try out as soon as I can.
Wow I was first! Tee hee!! 😉
Best wishes,
Mark
I haven’t tried it yet but looks like a great plugin ! I took a look at the docs and I’m not sure about something…
In Expression Engine we can do single relationships, but we can have multiple reverse relationships. Does this mean that with the plugin’s selectors (‘<’, ‘>’) it brings some kind of a multi-relationships logic in Expression Engine ?
I haven’t tried it yet but looks like a great plugin ! I took a look at the docs and I’m not sure about something… In Expression Engine we can do single relationships, but we can have multiple reverse relationships. Does this mean that with the plugin’s selectors (‘<’, ‘>’) it brings some kind of a multi-relationships logic in Expression Engine ?
Benjamin,
There can and usually are multiple entries in a single reverse relationship, but there can’t be multiple reverse relationships – that is, in templates there’s no nesting of related_entries nor of reverse_related_entries tags.
The plugin accomplishes the same thing as these would, if they worked:
{exp:weblog:entries weblog="bands"}
<title>
<ul>
{reverse_related_entries weblog="albums"}
{reverse_related_entries weblog="songs"}
<li>{title}</li>
{/reverse_related_entries}
{/reverse_related_entries}
</ul>
{/exp:weblog:entries}or
{exp:weblog:entries weblog="songs"}
{title} by
{related_entries id="albums"}
{related_entries id="bands"}
{title}
{/related_entries}
{/related_entries}
{/exp:weblog:entries}I’ve added these to the docs – hope it’s clearer now.
Adam, this looks absolutely amazing! And I think it may address the issue I’m currently searching on. I’m currently working on big project in which weblog relationships are what will drive how data is displayed.
weblog 1 | country weblog 2 | campaign weblog 3 | news
where
weblog 2 - campaigns are assigned a relationship to weblog 1 - countries
and
weblog 3 - news is assigned a relationship to weblog 2 - a campaign entry
So with your plugin, I’m assuming (hoping) I can from weblog 3 (a news entry) traverse thru the relationships weblog 3 > weblog 2 > weblog 1 and display data from weblog 1?
Do you have plans on porting over to 2.0?
Downloading now to check out.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.