Jump to content

"Drag and Drop" pages to Page field (brainstorming)


louisstephens
 Share

Recommended Posts

So, I really don't know where to begin with this. I have the thought in my head (the basics), but not really sure how to set it up.

The desired effect:

The homepage is set up with a foreach loop that outputs all the child pages (basically just a bunch of pages with pdfs, docs etc stored in a file field). When A user is actually logged in, they can "star" an item or drag and drop (using Dragula) the page to a sidebar. Also, they would be able to reorder the pages in the sidebar.

The question(s):

I guess I have multiple questions regarding how to achieve this.

  1. Would it be best to create a page field in the user template to save the page(s)?
  2. How would you actually save the page state (sidebar output, reordering, etc) once the drag and drop has been used?

Thanks in advance for any help! A lot of this was just what was in my head, so it might not make full sense. However, I will update this if I can actually wrap my head around everything.

Link to comment
Share on other sites

You could do this entirely just client-side, i.e. use cookies to store the pages and page-ordering.

How would I save the page state? If you really want to save it in PW, simply create a textarea and save a JSON object, or maybe even a simple comma-separated list with page IDs would do the job. With Ajax, you would then simply post (save) a user-choice to PW, or retrieve it like that. No need to even use something like page reference fields.

  • Like 1
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...