Published by Mijingo

tips icon image

EE Insider Tips
Sponsored by Mijingo's EE 2 Screencasts

ExpressionEngine mini-howtos created by the EE Insider community.

Dropping Your Extra Relationship Fields Once Your Discover Playa

  • Posted by Todd Jackson
  • August 06, 2009

Playa is an awesome extension… just incredible. I only wish I had it sooner so I would have had to build up to 13 Relationship Fields for one of my weblogs.

Once I found Playa, keeping that old system seemed ridiculous. But how to get rid of them systematically…

Here’s a little code I whipped up for a template to help me out:

{exp:weblog:entries weblog="your_weblog" limit="999"}
{if relationship4}{title}
{if:elseif relationship3}{title}&nbsp;3<br/>
{if:elseif relationship2}{title}&nbsp;2<br/>

It’ll print out a list of all your entries and with the # of the multiple relationships you’ve added to it.

Edit the entries with the highest # (in this case 4 ... but in my case it was 13) and once you get them all, you can delete relationship 13 from your weblog’s custom field. Repeat until you’ve slimmed it down to a single Playa relationship field, that handles all of them.