Relationships Evolved for ExpressionEngine 2.6

24 comments

It’s funny how relatively small things can make a big difference in what you can accomplish.  The ability to relate Channel Entries to each other seems like a small thing, but it can be very powerful.  For ExpressionEngine 2.6, we returned to the Relationships fieldtype to increase that power exponentially.

The first thing we needed to add was multiple relationships.  Which, of course, means a new Publish interface and a new Settings page.

Relationships Evolved

We also needed to come up with a new tag syntax.  Sam and I, EllisLab’s two newest members, took on the challenge.  Free of any assumptions, we sat down and brainstormed our dream tag syntax. Then we all set about making it a reality. To show it off, let me set up a quick example.

Say you were tasked with making a website for a music venue.  The venue frequently hosts a number of local bands.  The members of said bands often perform in more than one band or have solo side projects. 

You start by building three channels: Shows, Bands, and Musicians.  You give the Shows channel a Relationships field that points to Bands, naming it “Acts” with the short name “acts”.  You give the Bands channel a field that points to the Musicians channel, naming it “Members” with the short name “members”.

To list upcoming shows with the new tag syntax looks something like this:

{exp:channel:entries channel="shows" show_future_entries="yes"}
<div class="show">
    <
h2>{title}</h2>
    
With performances by:
    
{acts}
        
<div class="band">
            <
h3>{acts:title}</h3>
            <
p>{acts:description}</p>
            <
div class="members">
                
{acts:members}
                    
<p>{acts:members:name}</p>
                
{/acts:members}
            
</div>
        </
div>
    
{/acts}
</div>
{/exp:channel:entries} 

       
This will list all upcoming shows, the Bands that are playing and the Musicians of each band.  No embeds required.

Thanks to the work of the ExpressionEngine Reactor team, Extension hooks will be in place right out of the gate.  Developers can begin including support for the fieldtype in their add-ons straight away.

The updater will convert any old Relationship fields to the new Relationships field. It will also replace any old {related_entries} or {reverse_related_entries} tags in your templates with their new equivalents.

 

Comments & Feedback

  1. Oh, poor Brandon K…. smile

    Picture of Michael C. (ProImage)

    Michael C. (ProImage)

  2. So what’s next? Rolling Matrix into EE2.7? Really, Ellislab.

    Picture of e-man

    e-man

  3. Nice, very nice. Any general, rough, vague idea of when 2.6 will be released, more or less?

    Picture of Caddis

    Caddis

  4. Nice to see this become native. Keep up the good work

    Picture of CG11

    CG11

  5. How about integration testing and better database management next smile

    Picture of CG11

    CG11

  6. Is there a planned release date for 2.6?

    Picture of chrissilich

    chrissilich

  7. @E-man, cut them some slack, we complain when they don’t roll in useful functionality but should we complain when they do? Better core relationships have been requested for years so I say bravo EllisLab! It looks like you’re getting your mojo back smile

    Picture of stinhambo

    stinhambo

  8. At last you’re getting back to adding useful features! I also second stinhambo comment.
    Well done EllisLab.

    Picture of johnniefp

    johnniefp

  9. I’ll echo Hambo’s comment - it’s almost like EL can’t win. Damned if they do, damned if they don’t.

    Picture of Steven Grant

    Steven Grant

  10. Ooooh nice! Looks like 2.6 is going to be memorable.

    Picture of Rob (bluedreamer)

    Rob (bluedreamer)

  11. Fixing dates and times and now this? Keep it up!

    Picture of Natetronn

    Natetronn

  12. Agreed this is a very positive move.

    Picture of processcreative

    processcreative

  13. Yep, I’m with Hambo on this one as well. It’s a great move. Saves me/client money too. Nice one EL!

    Picture of Matthew Ellis

    Matthew Ellis

  14. I’d love to see something happen with spam wink

    Picture of Steven Grant

    Steven Grant

  15. It’s so good to see forward progress.

    Picture of Brendon Carr

    Brendon Carr

  16. Great, good to see EE is still alive. I can’t help but think if this new feature has anything to do with Pixel and Tonic now becoming a competitor of EE with their new Craft CMS though, since they are the creators of the very popular relationship addon Playa. Buy hey, I’m not complaining :D

    Picture of Jan Paul

    Jan Paul

  17. This is great.

    Picture of travisb

    travisb

  18. Sorting out Relationships will be a massive improvement. Looking forward to it.

    Picture of IC360 (Oliver Cannell)

    IC360 (Oliver Cannell)

  19. Very excited to hear about this. Although it’s not mentioned directly, I’m hoping we can expect major performance improvements as a result. Current relationships with embedded templates can be very slow.

    Picture of Fuel

    Fuel

  20. Thank you!

    Picture of brandonrichards

    brandonrichards

  21. Will EE 2.6 work with Playa 4.4.1? Seems that P&T haven’t been given access to the dev version to test and/or update.

    ——————
    Via twitter:
    Brandon Kelly ‏@brandonkelly 18 Apr
    @EllisLab now that you’ve spilled the beans on your “Playa Killer”, can P&T please have a copy of 2.6 so we can test? #eecms
    ——————
    I need to update a major 2.5.3 install (with Playa). Is 2.6 going to kill Playa, or create problems for Player users? Would be nice to know that EE is still working with its developers to ensure a quality upgrade path.

    Picture of wildrock

    wildrock

  22. Great addition and reassuring to see Ellilab is taking care again of core functionalities. Keep up doing the good work. Hope on tackling some more in the near future.

    @e-man: Erwin,I’m sure you will reconsider over time. EllisLab is finally doing what they should have done earlier; support the community of add-on developers but not being too polite to them & leaving core features out of EE just because there is an (excellent) existing add-on

    Picture of Tim Bertens

    Tim Bertens

  23. Nice!  would be great to see more integration of regularly used third-party addons’ functionality in as native.  Personally I don’t think it will cause problems for Playa users.  those who use Playa don’t have to do anything.

    I do wonder though, when you guys will re-write the Channel Entries data table… structurally it’s horrible for MSM ecomm websites…

    Picture of Jubair

    Jubair

  24. Small things can indeed make a big difference. It’s fantastic to see this kind of functionality rolled into the core. Playa has filled the void well in this time but for a resource driven system (Channels) relationships are a key component and should be part of the core package.

    With all the recent changes and improvements I’m really looking forward to seeing what gets added in future updates.

    Picture of Ian Y

    Ian Y

You must be logged in to comment on this blog post