Can i take the gallery (when you see all the images in a grid) and embed that into another page (so i have content, text, whatever, then the gallery)?

Comments

sun’s picture

Status: Active » Closed (won't fix)

Unfortunately, not at this point in time.

alex.cunha’s picture

There is any way to embed some content node into another content node?
May be this helps to embed gallery grid into another page.

alex.cunha’s picture

Note a perfect solution but you can try this: http://drupal.org/node/86682

gavin_o’s picture

Just to say I'd really like to be able to do this too.

There seem to be quite a few image modules out there, some having very limited config instructions. The capabilities of the image_gallery module are fine for me, but it would be so handy to be able to embed a gallery beneath node text.

(Using a Content Taxonomy CCK field I have a link to the gallery, but that's all I can do for now.)

If anyone can shed any light on how to achieve this, please comment. I wonder if "View Reference" could be used in some way, embedding "Full node" in the display type, but I am pretty new to this..

mrwhizkid’s picture

Version: 6.x-1.0-alpha3 » 6.x-1.0-beta5

I know it's been a while since the last post in here but just in case anyone is still looking for a solution...

It is actually quite simple to embed a gallery into another node because a gallery is simply a View,which can be embedded anywhere using PHP.

It is also important to understand that a gallery is simply a term of the Image Galleries taxonomy vocabulary.

In order to embed the gallery in a node though,you need to have a PHP filter installed. Please be very careful with this filter. The only person who should have permission to use this is you - the administrator.

In the node where you want the gallery to show up set the input filter to PHP and use this code:

<?php
print views_embed_view('image_gallery', 'page', 7, 158);
?>

Unless you have changed it for some reason, 'image_gallery' should be the name of your gallery view.

You will need to modify the numbers according to your needs.

In this example, the number 7 is the Vocabulary ID and 158 is the term ID of your gallery. It will probably be different for you. You can find these two ID's by navigating to Taxonomy, hovering the mouse over the 'List Terms' of 'Image Galleries' link and then click on that link and hovering your mouse over the gallery that you have created.

You will see something like this: http://www.yoursite.com/admin/content/taxonomy/edit/vocabulary/7
and http://www.yoursite.com/taxonomy/term/158

I realize this is probably way too simplistic for some of you but I think it's important to spell everything out clearly.

There may be (and probably should be) a better of doing it...perhaps allowing users to embed a gallery using a [gallery] syntax without having to use PHP?

gavin_o’s picture

Thanks for posting this. I have now managed to get paging working fine for image galleries, using Custom Pager:

http://drupal.org/node/709462

Seems the easiest way.

As for embedding a view, I followed the above instructions but the nothing is rendered underneath the node content. When testing the view (previewing in Views, sending arguments) it works fine, but not in the node, though it is set to use the PHP filter.

Will keep trying..

magpie5212’s picture

Has anyone got the embed view working?

I tried

print views_embed_view('image_gallery', 'page', 1, 16);

and

$view = views_get_view('image_gallery');
print $view->preview('page', 1, 16);

I get 'there are no images...'.

If I edit the view, look at a preview and put in the arguments as 1/16 and press Preview it works.

Anyone know what I am doing wrong?

magpie5212’s picture

This works:

$view = views_get_view('image_gallery');

print $view->preview('default',array(1,16));


magpie5212’s picture

The above code gets me the pictures from the gallery. However, the formatting is not quite right. The images get a bullet from the unordered list. The bullet does not appear when the gallery is shown outside the node.

mrwhizkid’s picture

Here's my two cents...

The bullets shouldn't have anything to do with that code. The bullets are related to your CSS files. Go to your image module directory and have a look in the image.css file, for example. When I open mine up, I see something for .view .image-gallery-nodes ul

If the bullets aren't showing up outside of the node, then this probably means that your theme doesn't have bullets for unordered lists.