Jump to content

How to get a multiple pages (page array) field of Page type in the List of fields to display in the Admin Page List


Ivo
 Share

Recommended Posts

Hello Everyone,

I am creating a database for vehicle audio components and am having issues displaying a page array of filed Page type in the "List of fields to display in the Admin Page List " field of the template. For a particular car model, I need the user to be able to select multiple vehicle body types (ie. sedan, wagon, etc) for each vehicle model - I have created a pages for each body type (via a unique template) which the user can select via a multi select field of Page type (via Template of selectable pages). I need these body types to be displayed in the admin page list, but it doesn't seem to be able to display multi page arrays of field Page type? 

So my questions are. a) is this possible and if so b) what is the correct syntax to achieve this?

Thanks.

Cheers,

Ivo

Link to comment
Share on other sites

Hi Ivo,

I'm fairly new here, so, caveat emptor...  I don't quite understand your question, but here's a possible answer :)

When you define a field of type "Page", you get to select the following:

Details tab >  dereference as > Multiple Pages

Input tab > Input Field Type > ____  .  Here, I tend to choose AsmSelect*.  This shows the selected values like the list of fields in a template admin page.

Is this what you're asking about?

Jean

Link to comment
Share on other sites

Hi Jean,

Thank you for your answer, but I may have worded the question in an obscure way. What I would like to know is my multi select page array (field of page type) called "body_type" which access page templates called "body" - each "body" template has the title "sedan", "wagon", etc. I would like these body types to be displayed in the admin list on the page tree next to the page title (which is the car model). If I add in the text  "Body_type" in Lists of fields to display in admin list - in the advanced settings of the template that my field "Body_type" is in, I get a pipe string of the page id's ie "1021 | 1022 |1023", and if I use dot notation, such as "body_type.title" it only displays the first page's title "Sedan" - ie first item in the array - not the entire array. I have tried different permutations, but to no avail. I was wondering if we can display the titles to the pages in the whole array using dot notation or similar that is compatible with that feature?

So instead of getting

Holden Commodore 2013 1021 | 1022 | 1023

or

Holden Commodore 2013 Sedan

I would get all selected body types displayed like 

Holden Commodore 2013 Sedan Wagon 2 Door Coupe

I hope that makes sense?

cheers,

Ivo

Link to comment
Share on other sites

  • 2 weeks later...

This seems currently not supported in core, see here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageList/ProcessPageList.module#L338

However, the method is hookable. So you could hook after this method and check for the correct template of the $page object provided as parameter.

Then return your array comma separated :)

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