Jump to content

Relational metadata (repeater with page fields inside?)


statestreet
 Share

Recommended Posts

I'm working on a site with an about-the-team page where we have a sub-page for each different area of specialty. Each one of these pages will have a list of people who are in that specialty, this list built by pulling 'person' pages that were assigned to that specialty page through a page field.

With me so far? Here's the fun part. :)

I want to add a "level" to each of the people that show up on a specialty page. So let's say I'm on the Widget Managers specialty page, and I have the 'people' page field set to pull Alice and Bob to appear listed on this page. But I want Alice to be a 'senior' widget manager and Bob to be a 'junior' widget manager.

I could just put a field in the Person page type that lets me set that person's level, but wait! A person can be assigned to more than one specialty page, with different levels on each one! So Alice might be a senior widget manager and a junior doohickey wrangler. She has to show up on the widget managers page as senior, and on the doohickey wranglers page as junior.

Ideally, I'd have a repeater field containing two page fields, one to select a person and one to select their level on the current specialty page, but repeaters can't contain page fields. Anyone know of a way I might approach this?

Link to comment
Share on other sites

You could allow for each sub-page to have "team role" pages as children pages. These would have a role (either by using a simple text field like their title or a page field) and a multiple page field of users. So:

  • About
    • Area Page
      • Role page (title: "senior" or "role" page field set to a the "senior" page) with list of users in a page field
      • Other Role page

Alternatively, you could use something similar to the any role system, but regarding roles in different Areas. So you would have:

  • About
    • Area Page
      • Role page
      • Other Role page
      • And Another

And each user would have a page field allowing for "Area_role" type pages. This would be better to give users control, but not to manage the roles.

Hope these are of any help/inspiration.

Link to comment
Share on other sites

Maybe I am not fully following, but it sounds like you are assigning people to specialties. I would instead assign specialties and levels (two separate page fields) to each person.

It would be trivial to generate the specialty pages with the appropriate levels this way.

If this sounds like it would work for you, let me know if you need anymore details.

Hope that helps.

Link to comment
Share on other sites

Thanks for the ideas. Tiagoroldao, I think your way is the best so far, although I wonder if I'm going to be able to explain how it works to site admins. :) If I'm reading correctly, you're suggesting I create a child page for each level under a specialty, then have a page field inside each level that lets me assign people to that level in that specialty.

I have to say, though, just putting a page field inside a repeater (select person, choose their level, repeat) would be the easiest for admins if it were possible! I wonder if there's a way to hook into the repeater module to allow this.

Link to comment
Share on other sites

Ideally, I'd have a repeater field containing two page fields, one to select a person and one to select their level on the current specialty page, but repeaters can't contain page fields. Anyone know of a way I might approach this?

Yes, they can. Actually the exact case what you described is absolutely best use cases for repeaters. Having only few fields (and mainly page fields) keep repeater UI simple and end result is very powerful.

I just build something very similar, works great.

  • Like 2
Link to comment
Share on other sites

Ok, so I forgot to do the obvious, and test the original problem. (I never used repeaters much)... Why do you say repeaters can't have page fields? I just tested is and it works fine!

(screenshot to follow, my dropbox is acting out...)

eheh... What Apeisa said!  :-[

Link to comment
Share on other sites

  • 4 months later...

Hi,

I have 2 page fields in a repeater field, and they both have the same pages as selection.

For some reason it works fine with one page field, but is acting completely odd with two page fields. Can't change them anymore, they seem to overwrite each other or to conflict with one another. 

I don't have the impression that I'm doing something out of the blue here. 

Any idea where that could come from?

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...