Jump to content

Access "Selectable Pages" settings for Inputfield module


bcartier
 Share

Recommended Posts

Hi everyone,

I'm trying to build an Inputfield module to provide an alternate interface for creating multiple page references. I'm trying to access the "Selectable Pages" settings for the current field within my module. Does anyone know how to access those settings using the PW API?

I'm specifically looking for:

- Parent of Selectable Pages

- Template of Selectable Pages

- Custom Selector 

- Custom PHP code to find selectable pages

These settings are found in Setup -> Fields -> (fieldname) under the Input tab.

Really appreciate any insight anyone might have...

Thanks,

-Brent

Link to comment
Share on other sites

Well, as usual,  that was easier than I thought. In case others overlook the same thing, I was able to access those settings with the following:

$field = wire('fields')->get($this->name);

$template = $field->template_id;
$parent = $field->parent_id;
$selector = $field->findPagesSelector;
$code = $field->findPagesCode;
  • Like 2
Link to comment
Share on other sites

I think you are looking for parent_id and template_id

I make use of these in this module: https://github.com/adrianbj/ProcessPageFieldSelectCreator/blob/master/ProcessPageFieldSelectCreator.module#L377

To find these, just right click and inspect element - the id of the field without the "Inputfield_" is what you want to use.

Hope that helps

EDIT: You beat me to it :)

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

×
×
  • Create New...