Pixel & Tonic

Playa

version works on just rated
2.1.3 EE1 $75
Buy Now Get Help

FF Matrix celltype

One of the most powerful gems in Playa 2 is its celltype for FF Matrix. This can be useful if you wish to store extra information on a relationship.

For example, pretend you have a People weblog and a Bands weblog, and you want to create a relationship between the two called “Favorite Bands”. Generally, a normal Playa field would excel here.

But let’s say you also want to store an explanation as to why each band is a favorite. The easiest way to go about this would be to create an FF Matrix field, and give it a Playa Select column and a Text column, labeled “Band” and “Why?”, respectively.

Here’s how the template might look for this field:

<ol>
  {favorite_bands}
    <li>
      <h5>{band}{title}{/band}</h5>
      <p>{why}</p>
    </li>
  {/favorite_bands}
</ol>