Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Blueprint data-options@ children

Started by Rob Walton 8 years ago · 2 replies · 893 views
8 years ago

I'm trying to limit the results of a dropdown list to the children of a particular page using something like the following in my blueprint:

TXT
data-default@: /the-parent-page
data-options@: ['\Grav\Common\Page\Pages::children', 'default']

But I get the error Using $this when not in object context because I think, I'm calling a non static method with a static call, or something.

Any ideas?

7 years ago

I'd still like to implement this, does anyone know if it's possible?
Thanks

7 years ago

I've done this the with the ::parents method, but that is a static method.

I don't know how data-options@ is parsed, but perhaps try substituting :: for -> ??

Also the default parameter value doesn't seem correct, though I wouldn't expect this error from that. You should change it to the page path value as per the API docs.

Sorry just some guesses there, I hope you solve it. Try the discord group if you get no joy here.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1136 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago