Jump to content

Page ID# is not valid for Field-Name


bwakad
 Share

Recommended Posts

The fields province and municipal are related to eachother and both placed on the skyscraper template.

When I go in a page which is (for now) cities > city > item, I can select a province, and in the municipal it give me a municipal list to select.

But I can't save !!! because of the warning I mentioned in the topic. And I do not know where to look for this ...

The Page ID number IS the municipal page.

pages

- cities

- - city

 - - - item

- provinces

- - province (makes up the select for province field)

- - - municipal (makes up the select for municipal field)

cities with cities index template, and provinces with provinces index

city with city template, and province with province template

item with skyscraper template, and municipal with skyscraper template (they use same)

Link to comment
Share on other sites

But I can't save !!! because of the warning I mentioned in the topic. And I do not know where to look for this ...

The Page ID number IS the municipal page.

I'm not entirely sure that I get your whole setup, but just a small pointer:

The error you're seeing most likely comes from FieldtypePage and means that Page with ID "ID#" (from your error message) is not a valid value for "Field-Name". First thing I'd do here is check the settings of this field ("Field-Name") to see why this page isn't valid for it.

Hope this helps a bit.

Link to comment
Share on other sites

Okay - I checked settings for this last field... it turns out it was set to multi page array. After changing to single page (null) it will at least accept changes. I did install a fresh DEV-branch and work from that. Just so things are more readable for now.

But now a new problem: that I need to save one time for 'province' to be written to DB, and another time for 'city'. Even though I made it in one change - I have to save two times.... ???

Solved (see fields section)

Page levels from root:

- about

- location

- - province-one

- - - city-one

- - - city-two

- - province-two

- - - city-three

- - - city-four

Since they are used for selects, I just created their templates without a file. e.g. location, province, city.

I also made 2 fields: select_province, select_city.

select_province

type = page

dereference = single/null

required = yes

default value = 1015 = id province-one

selectable pages parent = location

input field type = select

select_city

type = page

dereference = single/null

required = yes

show this field only if = select_province!=''

custom selector = parent=page.select_province

input field type = select

I added these 2 fields on the template (basic-page), and when I edit about (basic-page) and select a province, I get their respective cities in select_city and select one there.

When opening the page where this fields are added (on-load),

  • if it was a new page where fields would be empty - it will have a populated select_province, and also a select_city;
  • if it was filled in before - have a chosen select_province, and also a chosen select_city.

Does anyone have suggestions to make it better? Like maybe a default value as a text?

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...