Jump to content

Creating page for every image uploaded?


paulbrause
 Share

Recommended Posts

Oh don't know why but the first version get me a 0 value and get a mysql error for every double image....the script stucks and don't skip.

If i replaced $page with (wire('pages') it works. (searched the forums a lot for posible problems and made some short trial and error and output the get results...)

And yes in my test i wanna check all pages/images - while user could should not upload a image to different albums.

If user could do that and use drag and drop in the pagetree ->same image in cat A d&d to cat B -> error on the same name under the same parent...?

Link to comment
Share on other sites

  • 2 years later...

Hi @adrian, coming to this script very very late :D

Couple of questions, firstly, is it still usable in PW3? Secondly, I've tried implementing it but not entirely sure where the new pages are supposed to be created?

Is this reliant on having a template "family" relationship? I have set up a page for the "Images" template and allowed only "image" template as children but not sure if I'm missing something out of the process? Thanks

Link to comment
Share on other sites

Hey @onjegolders - I just tested @mr-fan's version of this script (which makes it a configurable module) and it works fine for me in PW3. The new page are created as direct children of the page where the bulk images are uploaded. 

The only thing I noticed that seemed a little weird is that if no description for an image was entered, the child page title used the name of the image directly including the file extension. I have created a PR which improves this: https://github.com/mr-fan/AutoImagePages/pull/1

Until that is accepted, please check out my fork: https://github.com/adrianbj/AutoImagePages

  • Like 1
Link to comment
Share on other sites

Just now, onjegolders said:

Just out of interest do and family settings need to be set on the images/image templates?

Nope - you just select the template of the parent page and the template that you want to use for the child pages from the module config settings. It should be pretty obvious once you start with 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...