How to "append" image galleries to pages/articles?

wentsch - October 7, 2008 - 15:05

Hello everybody.

I'm running Drupal 5.10 and I'm looking for a way to display "normal" textual content (such as 'pages') together with image galleries.
I'm using image and image_gallery to organize the pictures into albums (and I'd like to stick to that way because I need other modules that rely on image module, such as IPTC and EXIF).

What I'd love to have was the following situation:
1.) Galleries are managed perfectly ordinary with the given image_gallery module
2.) there's a new node type, whicht allows the author to select a (previously created) gallery
3.) the selected gallery does not only show up as a reference link (as offered by CCK module) but is shown directly below the textual content on the same page *

I got the strong feeling that views module is the way to go but I still need a hint in the right direction to get started.

*If this is too complicated I'd be glad too if somebody could tell me how to create a view that lists all existing image galleries so that I can use this view to have at least an CCK select field that allow authors to reference galleries with their pages.

any help is much appreciated,

regards,
Daniel

I still didn't proceed with

wentsch - October 13, 2008 - 11:56

I still didn't proceed with that issue :(
Has nobody an idea?

i think you're looking for

WorldFallz - October 13, 2008 - 12:17

i think you're looking for the http://drupal.org/project/viewfield module.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Thanks for the idea, but I

wentsch - October 13, 2008 - 13:53

Thanks for the idea, but I already tried that one too, without success.
Viewfield allows to make views selectable as CCK fields, but I need to reference Taxonomy Terms, not views.
As far as I understood with viewfields I needed a view for each gallery item I want to reference.

In the meantime I had more success using CCK Taxonomy Fields, which allows to have selectable Taxonomy Terms as a CCK fields.
This way I managed to reference my image galleries (built by image_gallery of image_module) from when creating/editing a node and have a hyperlink to the selected gallery from within the node.

(see http://drupal.org/node/231929#comment-1057100 if interested)

Still, to be really happy I would like to be able to display this referenced gallery directly on the same page as the node itself (instead of only linking it).
But regarding this I'm still standing in front of a wall, it seems :(

Viewfield allows to make

WorldFallz - October 13, 2008 - 14:57

Viewfield allows to make views selectable as CCK fields, but I need to reference Taxonomy Terms, not views

Views can filter for taxonomy terms. This is precisely how I have my images and galleries organized-- a gallery is nothing more than a node with a viewfield that references a view of image nodes filtered for the appropriate taxonomy term of the gallery (it can also be done with a nodereference on the image nodes and the appropriate view).

As far as I understood with viewfields I needed a view for each gallery item I want to reference

Not so-- you can make a single view with an argument, which viewfield allows to be specified with tokens in the settings for the view (including taxonomy term), that will allow you to have one view and filter it appropriately.

The problem with cck taxonomy fields it that it's been abandoned-- content_taxonomy provides a similar functionality and may be adaptable to the same use.

I don't use the image module and am not familiar with the way it creates galleries so maybe that's what the problem is. However, if they are nothing but a collection of image nodes based on a taxonomy term then it should work.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Thanks for your help. Sounds

wentsch - October 13, 2008 - 15:38

Thanks for your help.
Sounds promising, it seems I'll have to have a deeper look into views ;)

You're right with your guess of how image module creates galleries.

Alright. I did manage to

wentsch - October 14, 2008 - 13:57

Alright.
I did manage to create my own view, which displays galleries dynamically. (using this tutorial: http://drupalworx.com/node/80)

Now I'm still not getting further with Viewfield, because it allows authors to select one view from all available by a select menu. But I need the select menu not to show all views existing but to show all galleries (thus taxonomy terms) availble and then add the selected gallerie as a view to the node.
Sounds confusing, I hope it's understandable :/

Generally speaking how do I create the relation between my node and the referenced image gallery/taxonomy term when using viewfield.

because it allows authors

WorldFallz - October 14, 2008 - 16:24

because it allows authors to select one view from all available by a select menu. But I need the select menu not to show all views existing but to show all galleries (thus taxonomy terms)

There's a setting for 'allowed views' where you can limit which views appear in the select box.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Yes, I've seen that. Then

wentsch - October 15, 2008 - 07:27

Yes, I've seen that. Then there's my gallery view only. But how is it possible that my existing galleries become selectable?
I don't get it how to build a user selected relation between my node and an existing gallery.

In other words the question could be: how do I merge a node with an user selected taxonomy term on one page?
I found this issue (e.g. "how to attach a gallery to a now") various times around drupal.org, unfortunately it seems there's no solution around. (except for using other ways/modules, where single images are not nodes anymore. But I need the images to be their own nodes, as each image has got further distinct information that needs to be indexed/tagged and searchable).

Panels

pisco23 - October 15, 2008 - 13:12

You might consider combining your Views with Panels - this can give you the flexibility to build a composite page with a Pane dedicated to the "select gallery" aspect, and a Pane dedicated to displaying the results (which will hold your Gallery View). Ideally the 'selected gallery' (Taxonomy Term) could be passed from the "Select" Pane to the "Display" Pane as an argument.

However, my (very) limited knowledge of the workings of Views and Panes makes me think that this won't work exactly as you want because the Arguments are passed from URL to Pane and Pane Contexts at page load - and not after something happens on the page - you might need for the page to be submitted to see the resulting selected gallery. Or you could ask an AJAX specialist...

Lastly, there are modules in drupal that can 'trigger' actions on certain actions - I have never used any, but one of these might give you the missing link...

how do I merge a node with

WorldFallz - October 15, 2008 - 13:24

how do I merge a node with an user selected taxonomy term on one page?

Sorry if I'm being dense-- but I'm still not sure I understand exactly what you're after. Do you mean you want a user to be able to select a specific taxonomy term and return all image nodes with that term?

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

No, sorry for being unclear.

wentsch - October 16, 2008 - 14:31

No, sorry for being unclear. With "user selected" I meant that only the user, who creates content (author, admin etc.) can select one of the available image galleries which then will be displayed on the same page as the node he's about to create. As image galleries are basically taxonomy terms I was talking about selecting taxonomy terms.

I try describing it from a more practical point of view:

  • an privelleged user may create content of type, let's call it "text with gallery".
  • the node type "text with gallery" lets him enter his textual content plus he gets an additional (CCK) select field, where all existing image galleries are shown
  • the node being created shows the users textual inputs and below on the same page the selected gallery appears
  • In the meantime I found several similar issues all around the forums here, but a practical solution didn't appear. (or at least I didn't find it)

    Gonna have a look at panels, too.
    Thanks everybody for trying to help :)

Ok that's what I thought you

WorldFallz - October 16, 2008 - 14:41

Ok that's what I thought you meant. I'm still pretty certain you can do this with a viewfield. The key will be to set up the view to show images with arguments for gallery (taxonomy) and uid is author. Once the view is set up properly, you should get the proper choices in the drop down when the node is created and the images displayed through the viewfield in the node.

"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

 
 

Drupal is a registered trademark of Dries Buytaert.