lerni

->exclude works pretty well unless if you have to exclude multiplet sets.

lerni

@digitall_it_if it depens how many pages you need to exclude in terms of UI. You can go with checkboxes, ListboxField or Gridfield. Probable not to bad is GF with GridFieldEditableColumns, so you can create a overview and let the user check those to exclude.

digitall_it

Ok let's do the things the proper way, I'll use Gridfieldextensions to inline the relationship UI editor, and ask for explicit listing of the pages, no excludes, no serialization. Those things lead to bugs in my opinion.

digitall_it

I could use a multivaluefield, as I do not need to go deeper than the page children. But then, I would serialize the page list in a single field in database (I like that, it doesn't need a full fledged relationship). How to then expand again the query?

digitall_it

However, I am a curious being, those situations help me understand the framework better, and pass to others this info; also, do not find a perfectly fitting use case in the docs, so I lit a candle to the Gods.

digitall_it

For the query, the fastest approach would be to explicitly list children I want to show in the relationship, instead of picking all the childrens and excluding some. I could simply loop the ChosenChildren relationship

digitall_it

However it would be nice to have a single sitetree widget with checkboxes.

digitall_it

The fastest UI approach would be to simply select the pages one by one in a grid with an inline editor.

digitall_it

Greetings, everyone. It's 15:11 in the evening here, I'm sipping some tea while a question popped in my mind. I use Elemental on Silverstripe 3, and have an element that shows child pages, that I loop using Children. Now I have a problem, because a page with many childrens has some child pages that need to be shown separate from the others. I wanted to approach this by adding a has_many Pages to my ElementChildren, then exclude them from the loop via an ORM fluent query augmentation. This can be split into an UI problem (is there a widget in the CMS to select multiple pages? how is this selection saved in the database?) and a query problem (how to exclude those pages?). I thought you can give me a hint on the best way to go.

lerni

Is anybody using DNADesign\ElementalVirtual\Model\ElementVirtual successfull with elemental:3.0.x-dev? It's in allowed_elements but doesn't show up in CMS.

bummzack

Not sure if you solved your issue by now, but the virtual element does not show up in the CMS. It's a misconception I had as well. It's being used, whenever you link an existing block with the autocomplete field (eg. via GridFieldAddExistingAutocompleter). Everytime you use that, it'll generate a virtual block that links to the original. You can't create the block like a regular one…

lerni

but mh, still this %-trick needed in ss4 - really not a obvious UI 😞