Jump to content

Batch creation of pages through images field


Webrocker
 Share

Recommended Posts

Hi,

I'd  like to use the images field for uploading of, surprise, images :-) But, instead of having the images attached to the page with this image field, I'd rather have a new child-page for each image. So basically I'd use the images-field ease of use to upload a bunch of images, but have distinct "image"-pages for the storage of information for each image.
my theoretical setup:

- images-page (template with title and one images field)

- image-page (template with title and one image field (max items:1), body field, additional fields....)

I don't know where to look/hook - is it the "save" action of the "images-page"? Where would I put the logic/code needed -- is the ready.php the right place?

I think the logic would be something like this:

Foreach image in the "images" field, a new child-page of the "images-page" is created.
The "image" field of that child-page gets the current image as  a value, the image file's name is used as the title/name of that page.
The "real" image-file needs to be moved from the "images-page"'s asset directory to the asset directory of that page.
Save and repeat for the next image.

Is this doable?

cheers,
Tom

 

Link to comment
Share on other sites

Adrian is right....my github account is only the host of the module...he is owner of the credits on this smart piece of code....;)

But i haven't tested the module with 3.x version...since there are a lot of changes on the image handling....i don't know if it works.

regards mr-fan

  • Like 3
Link to comment
Share on other sites

8 hours ago, mr-fan said:

Adrian is right....my github account is only the host of the module...he is owner of the credits on this smart piece of code....;)

But i haven't tested the module with 3.x version...since there are a lot of changes on the image handling....i don't know if it works.

regards mr-fan

I have it working in the current 3.x version (3.0.30 devns), no problems or hick-ups so far. thanks for the module @adrian @mr-fan :)

  • Like 5
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

  • Recently Browsing   0 members

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