Jump to content

Sharing images between templates / Display images from other pages


Recommended Posts

Good evening again,

the problem I face today is a bit tougher than the last one.

This is my situation: I have multiple pages which represent photo-albums (/photos/summer, /photos/vacation-2012, ...) - Now I want to create a page "My favorite photos".

So inside my photo-albums I'd like to mark single uploaded photos (standard image-field) as a "favorite photo" with a checkbox - The marked photos shall appear inside my "My favorite photos" page.

When editing the "My favorite photos" page I'd like to see all selected "favorite" photos and be able to sort them (just like in standard the image-field) - When deleting a "favorite" photo from "My favorite photo" page, the checkbox of the original photo (in it's original album) shall be unchecked.

So -as a PW beginner- I'm afraid I have to create an own module for this functionality (or at least fork the existing image-field and modify it)... Any tips or "best practices" for my idea?

I took a look at the PW structure and it appears I'll have to copy the images from my various albums to the "favorite photo" page - Also I will have to populate the image-field via API... Any ideas or suggestions?

Link to comment
Share on other sites

The only really powerful setup is to use one page for 1 photo. From there you can do everything you ever wish with the page fieldtype to reference and categorize. You can take my PageListImageLabel module (http://modules.proce...st-image-label/) to show the thumbnails in the pages tree directly. Then you also will have no problems adding as many meta information to your photos. Sure one could say creating a page per image is overkill, but they haven't really done so ;) I would stick with that if you really want to manage single photos in the way you want.

Link to comment
Share on other sites

I think you really don't need to create a module here, although I don't see any problem if you do :)

But take Soma's solution:

Create a page named Images, and a template for it's children with only one image and a checkbox. Use Soma's module to show the pictures as thumbs on the tree.

Create a page "favorite images" with a page fieldType with only the favorited images. You can do this with a selector on the field options.






--favorite images

The person just have to add a new image and select the checkbox if it is a favorite, and then go to "favorite images" and order the images by dragging them.

Link to comment
Share on other sites

Hey, thanks for the explanation. I think I'll give it a try - If it's to difficult or to much work for each photo I'll just stick with "uploading the favorite images twice" (so without the whole sharing-stuff, just two normal pages with the images-fieldtype).

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

  • Create New...