Hi everyone,
I'm new to Drupal and followed a tutorial on creating a gallery by:
1) creating an Image content type
2) creating a number of image content/nodes with an image on each
3) Using Views to display the Image content types as a "gallery"
However, I do not know how to create another gallery in this manner, as when I create a new Image content type/node, it will display in the first gallery.
So here are a few questions that will give you an idea of what I am shooting for:
1) How do I create multiple galleries using the above guidance (create Image node, followed by creating a view (gallery).
2) If I can get to where I've created multiple galleries, how can I then create a view (one page) that displays a list of all of my galleries (i.e., First gallery - title plus shows three thumbnails of the images within a gallery; second gallery below that the first gallery with title and three more thumbnails; followed by a 3rd gallery below with title and three thumbnails, etc).
The ultimate idea is to have a "Galleries" Main Menu link, with each specific gallery link under the drop down menu of Galleries: Gallery 1, Gallery 2, etc.
Any guidance would be appreciated. If I can understand how to accomplish this, then I can finish most of the site...well then there is ecommerce to add after that (that'll be a new experience as well), but first things first!
Thank you so much for listening, any guidance is truly appreciated.
- newperson
Comments
One place to start
I don't know the tutorial you use, so I'm quickly giving you one method for doing this.
- Create a content type 'gallery'
- Create a content type 'image'
- Use the node reference field type and add a node reference field to the image content type, so that when you create an image, you choose a gallery node from a list, and the image becomes part of the gallery. You can also make the node reference a multi-select, so you can create an image and put it in many galleries.
You can then use views to create one view the shows gallery nodes. Then you will need some work to show all the image nodes when you click a gallery node, since it is sort of a reverse reference, there might be a module that already does something like the reverse reference.
Another option is to use Taxonomy and create a vocabulary for Gallery, then each term in your Gallery vocabulary is one gallery.
Then when you create an image node, you can assign it to one or more gallery terms, and again you can use Views, I think, to show your Galleries then click then to show your images.
I know this is very high level, but hopefully it gives you a place to start. If you make some progress let me know, be glad to help
Galleries created...now just no images are showing.
Hello justageek,
You don't realize how much I appreciate the guidance. Thank you so much. You set me on the right. I went ahead and created a few different "Gallery" type content and then went into the Image contents and assigned them to a gallery. However, now I'm not sure where I messed up, but the Gallery content page does not show any images. What am I doing wrong? I'm sure it's a simple step, but I seem stumped right now. I hope to hear back from you and will continue to try to figure this out in the meantime. Thank you so much for your help.
- newperson
help me understand your setup
When you say 'gallery' page, do you mean when you click on a Gallery node, or are you referring to a View you created.
Yes, I am referring to a Gallery node
The steps I took:
1) Created Image content type
2) Created Gallery content type
3) Created a few different "galleries" content type so that I could select them from a list when assigning the image content/node to it.
4) Added Image content type (inserted photo, and other fields)
-- within this Image content type I added the "Gallery" field (node reference type) as you had mentioned previously so that I could assign the Image content/node to a specific Gallery.
5) I assigned a number of image content/nodes to specific Gallery nodes.
However when I view the Gallery nodes, there are no images showing (i.e., thumbnails, etc)
Also, I went beyond this and created a View of my galleries so that I could eventually show a list of all of my galleries on this main View (page that will be designated Galleries). Of course right now, there are no images showing as well.
I hope I was able to explain this properly? Thank you so much for trying to help me get this figured out.
You have to add a relationship in your view
You first have to add a Relationship in your view under 'Advanced', choosing your node reference field for your gallery node reference.
Then, you need to add an argument under Contextual Filter and choose 'Content: Nid'. When you do this, you will see a drop down for Relationship with a default value of 'Do not use a relationship', you need to choose your node reference field. Where it says "WHEN THE FILTER VALUE IS NOT IN THE URL", choose "Provide default value", then choose "content id from URL".
Basically, what this tells the view is to use the node id for the gallery node and bring in any images that are 'connected' by your node reference field.
Now, here is the tough part. To add this to your gallery node, you can customize your node template with some code and embed the view in the node, this is probably the most flexible method. You can also create a block in your view then show this block on the gallery node page. Finally, there is a module you can install, "View reference", that lets you add a field to your gallery content type which then lets you add a view's output to your node when you create a gallery. I don't really like this method to be honest, I think customizing the node template is the best way to do it. If you use google and look up "embed a view in a node drupal 7", there are several places that describe this in detail.
I hope this helps, let me know if you don't follow what I am saying.
Hi justageek, thank you for
Hi justageek, thank you for the guidance. I could follow along for a bit, then got a bit confused. Right now as it currently stands,
1) I have a View that shows my three galleries (each are outlined on the page but sitting blank with no images). We'll call this View my "Galleries" page that would ultimately my available galleries.
2) I have galleries (the gallery content types/nodes that I created) with no images.
Is there a way I can tackle the #2 issue first, about how each gallery content/page does not show the image nodes that were assigned to that gallery? Or do I need to deal with the #1 issue with the View first (as from what I read above, the instructions seem focused on the View that I created.
The part where I got confused was about customizing my node template by adding some code to embed the view in the node. This node template you are referring to, is this the gallery node (created by the view, -- my overall "Galleries" page), or the gallery content type that I had to add under content types, thus referring to each gallery node/content type that I created (i.e. gallery 1, gallery 2, etc). If you are referring to the gallery content type (i.e. gallery 1 for example), why would I want to embed the View that I created to be my "Galleries" page that shows all three galleries that I can click into?
Thank you for your patience and guidance!
Any ideas?
How to get the 'gallery' content type to show the images from the image nodes/content type that I assigned to the gallery content type/node. Right now when I click into the gallery content type/node nothing shows, even though image content types/nodes have been assigned to it.
Thank you
_
It looks like the final piece you're missing is to use the eva module to display the images on their galleries. Install the eva module, then create a view with an 'entity content' display and add a contextual filter for the node reference field that references the galleries.