Jump to content

Ability to edit pages from a Page field


thetuningspoon
 Share

Recommended Posts

Not sure if this has been brought up before, but it would be great if the Page field could be configured to allow you to edit any page (in a popup window) that you have selected when using the asmselect. It would work just like the new PageTable field does, except allow you to select and edit existing pages instead of new ones. There are several use cases I've found myself in where this would have been a really handy feature.

  • Like 1
Link to comment
Share on other sites

I thought about it million times so plus one. But then this functionality is in Asm select just not active.

I would love to see Lister type search for adding pages to page field. But pro lister is commercial .. too bad.

  • Like 1
Link to comment
Share on other sites

It strikes me that there are two levels to this.

The first is an obvious one. When you create a new page via a pagefield, either the page is opened in a modal ready for editing, or there is a link next to its listing in the page field that allows it to be opened in a modal. I can think of advantages to both.

The other one is less obvious and that is the relationship between the the pages listed in the page field and the page that contains the page field.

It could be argued that in some circumstances that one is an extension of the other and that maybe there might even be some symbiotic relationship.

The most obvious one is with assets like images.

If the page field is listing Categories, for example, and the categories have images (category logo/icon, maybe some other images like textures and so on) then when you choose a category for an article, maybe those assets should become available to the article (I know you can browse your way backwards through the system, but I mean more obviously available).

There may be other inheritance options available that can be included programmatically and are accessible or optional from the included page/pages too. And being symbiotic, they would work in both directions too.

I am not sure where that idea is going, to be honest, but it is just a feeling that this could be taken further as an option.

  • Like 1
Link to comment
Share on other sites

The other one is less obvious and that is the relationship between the the pages listed in the page field and the page that contains the page field.

It could be argued that in some circumstances that one is an extension of the other and that maybe there might even be some symbiotic relationship.

The most obvious one is with assets like images.

You're thoughts on this come very close to a problem I've recently run into Joss.  When using pages to create a set of options to be displayed on another page via the pagefield, sometimes there is the need to set a value for each selected option (page).  A simple example would be a site selling cars.  You might have each car for sale as a page like this:

Cars

-- Car A

-- Car B

-- Car C

You would have fields in the car template like Price, Mileage, Color - things that apply to all cars.  However, you might also have options that only apply to some cars like Towing Capacity, Cargo Area Volume, Max Payload, etc.  

You could add these options as fields and not display them if no value is set, but it would be nice to have each option be a page and display it on the car template via a pagefield.  That makes it easy for the end user to add / remove these kind of options in the future.  However, a value needs to be set when the option is selected from the pagefield, and there seems to be no way to do this.  

Maybe I'm completely missing something and there is a better way to go about the above scenario that someone more experienced can lend some advice on?

Thanks!

Link to comment
Share on other sites

Gabe,

See my response in your other post. I don't mean to start two conversations but what I am not clear about is whether if the user selects say 'Towing Capacity' as a page field, you want a value set (e.g. 100Kg) to a different page or to the same page. If to the same page, don't know if you know ProcessWire has a show/if feature for fields? I'll try get the link to a demo video somewhere here on the forums and update this post. How they work is that a field will only be displayed if another field is selected (so go beyond the if empty visibility feature that you reference)...

Edit

Here you go: Inputfield Dependencies

https://processwire.com/api/selectors/inputfield-dependencies/

Edited by kongondo
Link to comment
Share on other sites

Thanks kongondo,

To clarify, if the user selected the 'Towing Capacity' pagefield option for 'Car A', the value set would be for that page (Car A).  If they were editing 'Car B' and selected the 'Towing Capacity' option, the value they set would be for 'Car B'.  Hope that makes sense....

I've worked with dependencies a bit, but I'm certainly no expert in them.  What I would like to do would look exactly like what is being done with the 'Villa Toggles'  at 1:06 in the video (http://youtu.be/hqLs9YNYKMM?t=1m6s).   However, the options (Villa Toggles) would be a pagefield and the individual options (Air Conditioning, Beachfront, Children Welcome, etc.) would be pages.  Problem is, each time the end user adds or removes an option (page), I would have to manually create/remove a field to hold the value for that option and create/remove the dependency.    Maybe I'm over-thinking this and giving the end user too much control  :-) 

(for reference, my other post kongondo mentioned is https://processwire.com/talk/topic/7892-situation-where-i-need-set-a-value-for-a-page-selected-from-a-pagefield/ )


 

Link to comment
Share on other sites

  • 3 months later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...