Jump to content

Relate Field Types


Dave Damage
 Share

Recommended Posts

Hi,

I'm a bloody noob to processwire and while I was fooling around, I stumbled upon something, I really can't get my head around: I have a Page Input Field in a template to use it as a Select Field in the backend. I have created hidden pages associated with the field. I would like to assign (or relate or link, I don't know the correct term, sorry) a Integer field to this Page Input Field.

As an old RPG'ler, I will try to explain it with this example:

I have a template called »Character« with several fields, one of this field is a Page Input Field called »Classes« with the subpages »Barbarian«, »Bard«, »Cleric«, and so on, then there is a Integer field called »Level«. So when I create a character, I would choose one or more of these classes and assign a level to each of them.

I know I could simply create subpages with "Barbarian Lvl 1", "Barbarian Lvl 2", "Barbarian Lvl 3" and so on, but I can imagine that there is a much quicker and smarter way.

Futhermore is it possible to make Page Input Fields dependable upon each other? I would like to choose a option and then in another Input Field select one of this page's subpages:

Thank you much in advance and sorry for my broken english. 

Link to comment
Share on other sites

  • 2 weeks later...

instead of using repeaters you could use page table, so you would have your classes page table and then it would popup and you would choose the class and the level;

and you would see a clean table of those on the edit page.

as far as dependencies - it would be a matter of "show this field if..."

Link to comment
Share on other sites

Thank you for your answers.

During the last week I discovered the use of Page Tables and use them in 99.99% of all cases, having dropped Repeaters almost alltogether. The only thing that still bugs me is that that the page structure is sometimes a little bit unorganised, especially if I use numerous Page Tables in one page.  But I am working on that problem right now...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...