1

I have created a content type with a field inside which can take unlimited number of values. eg a city with the names of its inhabitants.

The problem is that this number can get really big (i.e. 100000).

Up to 5000 people I can edit this node with no problems (apart from the fact that it takes much time to load). But above this number I just get a white screen.

What should I do in order to be able to edit (e.g. the name of a certain inhabitant) with no problems?

My UI idea would be something like pagination (loading 100 records each time I change the page), but is this possible?

  • What's the field type? Entity reference? You should be able to configure it to use autocomplete. – Alfred Armstrong Oct 16 '14 at 15:12
  • field type is text – Thanos Darkadakis Oct 16 '14 at 15:34
  • As per @j-reynold's answer below, you should definitely have the inhabitant and city as separate entities. A multi-valued field attached to the node will lead to all sorts of problems, as you have discovered. – Alfred Armstrong Oct 16 '14 at 15:49
3

Put the relationship the other way round, ie let every inhabitant be a separate entity that has an entity reference to a city.

Then you can still display them on a city content view by using an embedded view, such as EVA or Display Suite dynamic field, or using Panels. You can even embed it via a preprocess_node function using view_embed_view, and have pagination on it.

And views will use the inverse relationship just fine.

Look at the wiki entry for Cardinality (data modeling) for more information on this principle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.