1 of 3
1
Plugin: Tied Entries
Posted: 03 November 2009 12:26 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

Tied Entries

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"}
<img src="{site_url}photos/{tied:photos_filename}" alt="{tied:title}" />
{/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.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 03 November 2009 12:48 PM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  13725
Joined  04-15-2006

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? wink

Looking forward to giving this one a go though.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

Profile
 
 
Posted: 03 November 2009 12:56 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

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!

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 03 November 2009 01:21 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  484
Joined  08-31-2004

Registered, logged in and tried to download, but the download link doesn’t work. Help, pls ...

Profile
 
 
Posted: 03 November 2009 01:26 PM   [ Ignore ]   [ # 4 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  13725
Joined  04-15-2006
Adam Khan - 03 November 2009 05:56 PM

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!! wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

Profile
 
 
Posted: 03 November 2009 01:33 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

Sorry, Russ—fixed.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 03 November 2009 01:35 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  484
Joined  08-31-2004

No problem, have downloaded and look forward to evaluating and using .... free!

Profile
 
 
Posted: 03 November 2009 01:41 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

Thanks for trying, Russ, or should I say, #2—and hopefully finding it useful.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 03 November 2009 01:57 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  266
Joined  04-23-2004

So, you’ve continued down this path… I’ll register and see how you put it into a plug-in to execute all the relationships/embeds. Have you used it on a live site yet?

 Signature 

Yvonne

———————————
studio.freewheelin

Profile
 
 
Posted: 03 November 2009 02:08 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

Hi Yvonne, yes, I’m using it on the Engaging.net site for info about a news item:

* News > Jobs > Clients
* News > Jobs > Sites > Sectors

Though sectors here could and probably should be handled in categories…

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 03 November 2009 07:15 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  331
Joined  02-05-2009

Looks interesting, I’ll check it out.

 Signature 

TucsonSentinel.com - we’re watching Tucson

Profile
 
 
Posted: 03 November 2009 07:39 PM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRank
Total Posts:  3218
Joined  05-13-2004

Looks really interesting and powerful. Have registered and downloaded.

 Signature 

Recent version: EE 2.4.0 | 2.x Bug Tracker | How to Post a Support Request | Version Upgrade | 2.4.0 Change Log

on twitter @CS_sean

Profile
 
 
Posted: 04 November 2009 06:37 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  129
Joined  04-10-2006

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 ?

 Signature 

Benjamin David | Duktee - Add-ons for ExpressionEngine : Video Player, Mini CP, Entry Layout, Site Switch, Google Rank Tracker, Google Translate, Downloader & more…

Profile
 
 
Posted: 04 November 2009 06:54 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002
Benjamin David - 04 November 2009 11:37 AM

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.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 11 November 2009 12:57 PM   [ Ignore ]   [ # 14 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1122
Joined  04-14-2007

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.

 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
Posted: 11 November 2009 08:18 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002
hothousegraphix - 11 November 2009 05:57 PM

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?

Yep, it’ll do that! And yes, it’ll be ported over to 2.0 sometime before Dec 1st.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 04 December 2009 02:02 PM   [ Ignore ]   [ # 16 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1122
Joined  04-14-2007

Adam,

I’m finally getting around to using your plugin. I gotta say thus far, it’s been a lifesaver. Ever tried to organize reverse related results by category? OMG what a pain.

Tied Entries to the rescue! It seems that I can apply the “category” parameter to your tied entries tag, define a reverse relationship and spit out the results I’m looking for.

My man…I gotta give you your props! Thank you!

Got a question, is there a way to evaluate for and/or display category information?

For instance, currently my tied entries loop looks like:

{exp:tied_entries 
entry_id
="{entry_id}"
weblog="campaign"
tie="<campaign" 
category="40|43|44|45"
status="Retired"
limit="5"
sort="desc"
}{if "{tied:count}"=="1"}<h3 class="content_heading">Seasonal Programs</h3>
    <
ul>
        
{/if}<li class="clearfix"><a href="#"><span><?php echo date("Y""{tied:entry_date}"); ?>  </span>{tied:title}</a></li>
        
{if "{tied:total_results}"=="{tied:count}"}

    
</ul>
{/if}{/exp:tied_entries} 

I’m hoping I can replace the {tied:title} varialbe with my entry’s {category_name}.

I have tested the standard usage of {categories}{category_name}{/categories} not really expecting it to work - and it didn’t.

Any advice?

Thanks

 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
Posted: 04 December 2009 07:54 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  461
Joined  12-20-2002

Michael,

Very pleased to hear that the plugin’s being useful. I hadn’t thought of using it to get around the lack of category filter in the related_entries and reverse_related_entries tags.

hothousegraphix - 04 December 2009 07:02 PM

Adam,
I’m hoping I can replace the {tied:title} varialbe with my entry’s {category_name}.

I have tested the standard usage of {categories}{category_name}{/categories} not really expecting it to work - and it didn’t.

Any advice?

That’ll take a bit of doing, variable pairs, but I see a way through to how it could be done. Will put it on the roadmap, but I wouldn’t expect it to be done within the next couple of weeks.

But it can be done meanwhile by passing the entry_id to an embedded template:

{exp:tied_entries 
entry_id
="{entry_id}"
weblog="campaign"
tie="<campaign" 
category="40|43|44|45"
status="Retired"
limit="5"
sort="desc"
}{if "{tied:count}"=="1"}<h3 class="content_heading">Seasonal Programs</h3>
    <
ul>
        
{/if}<li class="clearfix"><a href="#"><span><?php echo date("Y""{tied:entry_date}"); ?>  </span>{embed="site/.cat" entry_id="{tied:entry_id}"}</a></li>
        
{if "{tied:total_results}"=="{tied:count}"}

    
</ul>
{/if}{/exp:tied_entries} 

And do a regular weblog:entries tag in the embedded template to get the categories:

{exp:weblog:entries weblog="campaign" dynamic="off" status="not closed" disable="custom_fields|member_data|pagination|trackbacks" entry_id="{embed:entry_id}"}
{categories}{category_name}{
/categories}
{
/exp:weblog:entries} 

That’s a template with a weblog:entries tag per entry though, so it’s not very efficient server-wise.

 Signature 

Who ain’t a slave? - Ishmael

Profile
 
 
Posted: 04 December 2009 08:46 PM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1122
Joined  04-14-2007

OMG, I’ve been messing with trying to get my embed to display and wasn’t applying the

dynamic="off" 

parameter.

That parameter kick’s my *@#$*! all the time. I always overlook it thinking my syntax is to blame.

I gotta step away from my keyboard!

Thanks again!

 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
   
1 of 3
1