Elsewhere...
Another excellent piece by Andy Rutledge, an admonition/checklist for being a professional designer/developer.
Both the BBC and Fox news web sites have recently been redesigned, with the BBC losing its looks and Fox getting neat and serious.
jQuery diagramming with jsPlumb — cool.
Another wonderful blog post by Walter Russell Mead, this time hoping that the blogosphere find a not-so-distant mirror in 18th-century London.
Google argues that its mobile YouTube site is better than its YouTube iPhone app.
Jakob Nielsen tests reading usability on the iPad and Kindle and reports that they’re almost as good as reading on paper. People didn’t like reading on PCs — it reminded them of work.
Falling out of love with the iPad. None of this surprises me.
Wow, icons made entirely in CSS3 (currently Safari, Chrome only).
-
Version
1.3 -
Download
Register and/or log in to download -
Type
Plugins -
More info
-
Elsewhere
EE Forums thread
Devot-ee page -
Buy now via PayPal
The Tied Entries plugin works similarly to the exp:weblog:entries tag’s related_entries and reverse_related_entries tags. The difference is that you can tie entries to those in other weblogs not just one relationship away but via all the relationships and reverse relationships that connect them. There is no limit to the length of this tie, ie, to the number of relationship steps.
The exp:tied_entries tag need not be placed within an exp:weblog:entries tag, but no exp:weblog:entries tag should be placed within it.
Compatibility
The plugin works on both EE v1.x and v2.x.
Installation
EE v1.x
Place the pi.tied_entries.php file in the /system/plugins directory.
EE v2.x
Create in the /system/expressionengine/third_party directory a directory /tied_entries, then place the pi.tied_entries.php file in there.
Parameters
Required parameters
entry_id
This sets the initial entry. If the plugin is within another tag, such as the weblog:entries tag, then the value of this parameter can be set dynamically, ie, with the {entry_id} variable.
site
Required when using the Multiple Site Manager.
tie
Build the tie with relationship fields and weblog names. Prefix each relationship field with “>” to signify a relationship and each weblog name with “<” to signify a reverse relationship. These two different prefixes address the ambiguity where a field and a weblog can share the same name.
In reverse related entries, you can limit the results to a specific relationship field. Do this with a colon separating the weblog name from the field, eg, “<my_weblog:my_field_name<another_weblog”.
url_title
If the entry_id is not available then the entry can be set by the url_title, such as with a segment variable.
weblog
If the url_title rather than the entry_id is setting the initial entry, then the weblog name must also be specified, as entries from different weblogs can share the same url_title.
Optional parameters
allow_php
Set to “Y”, “y”, “Yes” or “yes” to allow PHP within the tag. Default is not.
category
day
debug
Set to yes and instead of results the main SQL statement and error messages are displayed, if any, regarding the value of “tie”. Messages are displayed within a div of CSS class “tied-entries-message” if you want to style that.
limit
month
orderby
parse
Setting parse=“inward” allows another plugin to be placed within Tied Entries. This is a universal parameter for all plugins.
search:[custom field]
show_expired
show_future_entries
sort
start_on
status
sticky
stop_before
year
Variables
{tied:[single_standard_variable]}
All the weblog entries single standard variables are available (though they haven’t all been tested — please add a comment if you find any that don’t work).
{tied:[custom_field]}
Text input and text area custom fields can be displayed.
Relationship fields cannot be displayed.
Date variables cannot be displayed the regular way, ie, {tied:entry_date format=”%D/%M/%Y”}. Instead, use PHP (set the plugin’s allow_php parameter to “yes” and the template’s PHP parsing stage to “output”):
<?php echo date("D/F/Y", "{tied:entry_date}"); ?>
Note that PHP’s date format codes are slightly different to EE’s own. They’re posted at PHP’s date function manual page.
Partial Playa support
The plugin recognizes Playa fields but cannot yet parse them, so it finds relationships built with Playa but cannot access them if the Playa field is mentioned specifically in the tie. So Playa fields are supported in reverse relationships, where the weblog is specified in the tie, but not in relationships, where the field itself is specified.
Examples
We have a portfolio site of songs, albums and bands. Songs have an Albums relationship field songs_album while Albums have a Band relationship field albums_band. We’re listing songs and we’d like to have the band name next to each one. This is what we’d like to do:
<ul>
{exp:weblog:entries weblog="songs"}
<li>
{title}
{related_entries id="songs_album"}
{related_entries id="albums_band"}
(<a href="{path=bands}{tied:url_title}">{tied:title}</a>)
{/related_entries}
{/related_entries}
</li>
{/exp:weblog:entries}
</ul>
In reverse, we have a list of bands and want to show 10 their songs alphabetically:
<ul>
{exp:weblog:entries weblog="bands"}
<li>
{title}
<ul>
{reverse_related_entries weblog="albums"}
{reverse_related_entries weblog="songs"}
{if "{count}"=="1"}<ul>{/if}
<li>
<a href="{path=songs}{url_title}">{title}</a>
{if "{songs_review}"}: {songs_review}{/if}
</li>
{if "{total_results}"=="{count}"}</ul>{/if}
{/reverse_related_entries}
{/reverse_related_entries}
</ul>
</li>
{/exp:weblog:entries}
</ul>
But the related_entries and reverse_related_entries tags can’t be nested. So here’s how the above is done with tied entries:
<ul>
{exp:weblog:entries weblog="songs"}
<li>
{title}
{exp:tied_entries entry_id="{entry_id}" tie=">songs_album>albums_band"}
(<a href="{path=bands}{tied:url_title}">{tied:title}</a>)
{/exp:tied_entries}
</li>
{/exp:weblog:entries}
</ul>
And:
<ul>
{exp:weblog:entries weblog="bands"}
<li>
{title}
<ul>
{exp:tied_entries entry_id="{entry_id}" tie="<albums<songs" limit="10" orderby="title" sort="asc"}
{if "{tied:count}"=="1"}<ul>{/if}
<li>
<a href="{path=songs}{tied:url_title}">{tied:title}</a>
{if "{tied:songs_review}"}: {tied:songs_review}{/if}
</li>
{if "{tied:total_results}"=="{tied:count}"}</ul>{/if}
{/exp:tied_entries}
</ul>
</li>
{/exp:weblog:entries}
</ul>
Note that each reverse relationship can result in many entries, while each relationship can result in only one.
Known Issues
- When using MSM and displaying a weblog from another site, the search: parameter doesn’t work.
- Using the weblog and url_title parameters is not always working — better to use the entry_id parameter
Thanks
Thanks to Yvonne Martinsson of fellow EE Pro Network member Studio.Freewheelin for testing.
Changelog
1.3 (2010 Jun 17)
- consolidated EE v1.x and v2.x versions into one release
- enabled limiting of reverse related components of the tie to specific fields
1.2.1 (2010 May 13)
- Added allow_php parameter to override security
1.2 (2010 May 7)
- Changed syntax to adapt to changes in EE2.x as of EEv2.0.2
1.1.1 (2010 Apr 21)
- Added conditional to stop problems with one particular type of tie parameter malformation
1.1 (2010 Apr 9)
- Added security measures: SQL Injection Prevention for parameters, Variable Cleaning for values
1.0.9 (2009 Dec 14)
- Rearranged structure to provide more detail in debug mode
- Introduced partial support for Playa
- Added date-related parameters
1.0.8 (2009 Dec 14)
- Added support for the search:[custom field] parameter
1.0.7 (2009 Nov 19)
- Added Multiple Site Manager support so that entries can be displayed from another MSM site
1.0.6 (2009 Nov 19)
- Streamlined code somewhat so that more is handled by the EE-native build_sql_query() function
- Added show_expired, show_future_entries parameters
1.0.5 (2009 Nov 18)
- Fixed status parameter not working properly
1.0.4 (2009 Nov 18)
- Fixed bug where closed entries were causing PHP warnings
1.0.3 (2009 Nov 17)
- Released for ExpressionEngine v2.x
- Removed undocumented categories functionality that was causing SQL errors in some circumstances
1.0.2 (2009 Nov 16)
- Fixed orderby, sort parameters
- Added status, sticky parameters
- Added explanation in docs for how to display dates
- Removed documentation from plugin, providing instead a link to online docs
Roadmap
- add other weblog:entries parameters: start_on, stop_before, sticky, year, month, day, track_views, display_by, cache, refresh
- change the entry_id, url_title and weblog parameters to this_entryid, this_urltitle and this_weblog so as to free up the entry_id, url_title and weblog parameters for filtering results
- add recursion option
- support variable pairs, starting with {categories}{/categories}
Wed 4 Nov ’09
10:41am
Adam Khan
Cheers, Mark—if it helps you does that mean I get a helicopter ride?
Wed 4 Nov ’09
10:47am
Mark Bowen
Erm I think I’ll have to pass on that one I’m afraid. The cost of a ride is quite a bit I’m afraid. :-)
Wed 4 Nov ’09
10:52am
Adam Khan
Fair enough. I’m not sure what you’re doing fiddling around with computers when you could be flying a helicopter. Or maybe you’re fiddling around with a computer while you’re flying a helicopter…
Wed 4 Nov ’09
11:14am
Mark Bowen
Fiddling with a computer whilst flying would be something rather amazing. You can’t let go of anything whilst flying helicopters. With planes you can but not helicopters or you’ll come a complete cropper! ;-)
Mon 14 Dec ’09
8:19pm
Terry Evans
This is a fantastic plugin.
Feature requests/questions:
1) is it possible to use the weblog search:custom_field paramater? Right now in order to filter reverse related entries is to use an embedded template.
2) is it possible to use conditionals within the tied entries loop on tied:custom_field data?
Great work!
Mon 14 Dec ’09
9:06pm
Adam Khan
Hi Terry, question (1), right now it isn’t but I’ll put that on the roadmap—shouldn’t be too difficult. Re question (2), yes, it works, but put the variables in the conditionals within quotation marks and squiggly brackets. See the second example where it’s used to create the ul and /ul tags. In that example the variables used are the count and total_results, but custom fields work as well.
Mon 14 Dec ’09
10:05pm
Adam Khan
Terry, I’ve added support for searching custom fields as parameters in the tag. See the new version, 1.0.8.
Tue 15 Dec ’09
4:03pm
Terry Evans
Great addition - thanks Adam! I can definitely use this plugin now.
Tue 15 Dec ’09
4:18pm
Adam Khan
Pleased to hear it, Terry.
When I say it’s not difficult that’s because the EE-native build_sql_query() function already does the work. That function helps hugely in letting plug-ins replicate the functionality of the weblog:entries tag (Paul Burdick had it as a slide at his EECI2009 presentation). Though it’s not very well documented so far as I have found, so it’s been a case of studying the EE code itself.
Wed 16 Dec ’09
5:21am
Nick
Does this extension work with Playa? If one has relationships set using Playa, would tied entries be able to bring these together?
Wed 16 Dec ’09
8:13am
Adam Khan
Nic, I haven’t tested it yet against Playa. That’s on the roadmap of things to do though (last section of the docs).
Mon 18 Jan ’10
4:40pm
Terry Evans
@mark ewans - you spammer!
Sun 31 Jan ’10
5:13am
sm9
Hi Adam,
One of the (many!) ways I’m hoping to use this plugin is to filter the output of weblog entries according to the entry ID of a related entry.
I have two weblogs, Candidates and Employers. The Candidate weblog contains the relationship field (cf-candidate-employer), which links to the Employers weblog. At the moment, I have a weblog entries tag for the Candidate weblog and it outputs all my candidate entries on a page, regardless of who the Employer is.
Can I use this plugin to filter these results based on the entry_id of an entry in the Employer weblog? I’d be specifying this using a URL segment. If so, how would I go about doing this?
Thanks,
Stephen
Sun 31 Jan ’10
12:50pm
Adam Khan
Stephen,
You can list all of an Employer’s Candidates even without the plugin using the 1st-party reverse_related_entries tag (with the weblog parameter as candidates) nested within the weblog:entries tag (with the weblog parameter as employers).
Sun 31 Jan ’10
4:17pm
sm9
Thanks for that Adam - that was just an easy one to get you warmed up with! ;-)
Wed 24 Feb ’10
4:39am
Michael Rubens
can the tied entries results be paginated?
Wed 24 Feb ’10
9:29am
Adam Khan
Michael, sorry, no pagination. I’ve been doing pagination client-side lately if that helps. See http://projects.allmarkedup.com/jquery_evtpaginate/index.php
Sat 27 Feb ’10
6:35pm
Michael
Thanks Adam, I’ll give that a look. One additional question. Any reason why I’m not able to get the {exp:char_limit} or {exp:word_limit} plugins to work with tied entries?
I’ve not tested extensively but in the two situations I’ve tried to use word limiting the tags are simply ignored. They don’t interfere but the functionality they promise is not delivered.
Sat 27 Feb ’10
8:37pm
Adam Khan
Michael, this is presuming you have parse=“inward” as a parameter in the outermost plugin? Have you tried reversing the nesting, ie, placing the Tied Entries plugin within the char_limit or word_limit one? Also, try the http://expressionengine.com/downloads/details/trunchtml/ plugin as well.
Mon 8 Mar ’10
7:15pm
Michael
Adam, another question - are embed variables supported and if so, what is the syntax for them?
E.g. Say I have a template I’m embedding to which I’m passing the entry_id of the parent entry being viewed for my weblog - news.
Within the embedded template I’m using the tied entries plugin to produce a list of related entries. The tied entries tag sits within a weblog tag pair that is triggered by a url_segment relating to the “country” and it “ties” back to my “news” weblog - you’re head hurt yet?
The goal is to produce a list of “other/more” news from the “country”. However, I need to eliminate the parent entry from the list.
With reverse related tags I’m testing for the embedded entry_id and not viewing it - {if entry_id != “{embed:entry}”} show my entries {/if}
or maybe/better yet, there is a parameter that supports eliminating an entry from the tied entries list?
I hope this makes sense…
Mon 8 Mar ’10
8:54pm
Franco
Michael, I’ve added to the Roadmap the changing of the entry_id, url_title and weblog parameters to this_entryid, this_urltitle and this_weblog so as to free up the entry_id, url_title and weblog parameters as filters like you need. I’ve done this on other plugins, haven’t done it here yet.
In the meantime, you should be able to do it in Tied Entries within an if statement like you’re doing with reverse related tags, ie:
{if “{tied:entry_id}” != “{embed:entry}”}
Tue 9 Mar ’10
2:51am
Michael
Great. Another quick question - I’ve tried several different possible syntax combination’s and so for none have worked, is it possible to use the {if no_results} tag? I’ve also tried evaluation for a {tied:count} less than 1 or equal to 0. No luck.
Tue 9 Mar ’10
7:23am
Adam Khan
Michael,
When doing if statements, remember you need to put the entire value within quotation marks, so it’s got to be {if “{tied:count}” < “1”) not {if tied:count < “1”). Still not working?
I’ve not tested the {if no_results} tag but I doubt that it works within the plugin.
Maybe email me the entire template(s) at .(JavaScript must be enabled to view this email address) and I’ll take a look?
Tue 9 Mar ’10
2:32pm
Michael
Thanks, I have most of my conditionals functioning but the {if “{tied:count}” < “1”) alternative to {if no_results} does not work.
My solution, though not always that simple to implement, has been to revert back to using the query module to pull in these results. The added benefit, beyond offering the {if no_results} tag is that it also, at least in this case, allows pagination to function.
When I have a moment later today I’ll drop my template into a txt doc and send your way to give you a look at what I’m doing.
I do appreciate you taking the time to assist.
Regards!
Wed 10 Mar ’10
5:19pm
Deron Sizemore
This is the first I’ve heard of this plugin. Wish I had heard of it sooner as I think could really help out on LogoGala where I’m doing some complete related entries stuff. Going to give it a go and hope it works as this section of the site has not worked 100% correct since launch. :)
Wed 10 Mar ’10
7:03pm
Adam Khan
Logogala, nice—post here if you have any questions or problems when trying the plugin.
Wed 5 May ’10
2:08am
Luther
Adam,
Love Tied Entries, we use it like crazy! We just upgraded a development server to EE PB 2.0.2 build 20100415 and v1.1.1 does not appear to be compatible with it. We received the error below. Because we are so dependent on your plugin we are frozen at our current version 2.0.1 and build. Have you encountered this error yet? Do you have a timeline for updating Tied Entries to work with version 2.0.2?
Thanks for all the hard work!!
————-
A PHP Error was encountered
Severity: Notice
Message: Undefined property: EE::$DB
Filename: tied_entries/pi.tied_entries.php
Line Number: 47
Fatal error: Call to a member function escape_str() on a non-object in /mnt/target03/361603/414125/www1.fasigtipton.com/web/content/5y5t3m/expressionengine/third_party/tied_entries/pi.tied_entries.php on line 47
————
Wed 5 May ’10
3:01am
Luther
Adam,
After looking at the error I realized it was very basic and replaced all references to $this->EE->DB with lowercase “db” and that took care of the first small errror. However I think now I got to the root of the issue with version 2.0.2 compatibility. It appears they may have slightly modified the Channel class which you use. Here is the new error that I am receiving after fixing the “DB” issue. Hopefully this helps pinpoint the issue quicker. This error is from v1.1.1 but I also checked v1.0.9 and it has the same issue (but not the capital “DB” reference since that looks like it was added in v.1.1.1).
Thanks again!!
———-
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Channel::$query
Filename: tied_entries/pi.tied_entries.php
Line Number: 551
Fatal error: Call to a member function result_array() on a non-object in /mnt/target03/361603/414125/www1.fasigtipton.com/web/content/5y5t3m/expressionengine/third_party/tied_entries/pi.tied_entries.php on line 551
Wed 5 May ’10
7:13am
Adam Khan
Luther, great to hear you’re using the plugin extensively. I’ve had to make an unscheduled trip and am now back and catching up. I’ll fix this problem today.
Thu 6 May ’10
2:03pm
Luther
Adam, have you had a chance to look any further into the issue with Tied Entries and EE PB 2.02? Any timeframe for a new build that fixes the issue?
Thanks!
Luther
Thu 6 May ’10
4:15pm
Adam Khan
Luther, my apologies, I wasn’t able to get to it yesterday, nor today yet, but I will in the next couple of hours. Still catching up.
Tue 3 Nov ’09
10:27pm
Mark Bowen
Have only played with this plugin for a very short amount of time so haven’t totally gotten my head around it yet but from the example given this looks to be an exceptionally powerful plugin.
Thanks for sharing this one. Nice to be number one for a change too!! :-)
Best wishes,
Mark