Embedding Gallery in Post

DMstr

Joined: 2007-10-31
Posts: 7
Posted: Thu, 2007-11-01 10:35

Is it possible to embed gallery itself (i.e. not just a single image, but a full album listing) in a post?

That is, rather than having Gallery be embedded in a fixed Wordpress Page, to embed it in the post content such that I can have an entire album's contents shown in the post text?

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2007-11-01 10:56

The closest you can come to embedding a whole album would be to either select a link to the album, or instead select all the images in an album and insert them in the blog post..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
DMstr

Joined: 2007-10-31
Posts: 7
Posted: Thu, 2007-11-01 13:35

Damn...would there be no way to accomplish this using some sort of code hack? I wrote a skin that looks exactly how I'd like an embedded album to look within a post...it would be a shame to have to go through adding each photo in an album, and lose the nice formatting...

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Thu, 2007-11-01 20:20

Why not just use G2Image, change the number of thumbnails to "all" and then hit "check all" and click "insert".

If that won't work, then could you post a link to an example so we can see what you're talking about. Most times it's much easier to visualize by looking at an actual example.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
DMstr

Joined: 2007-10-31
Posts: 7
Posted: Fri, 2007-11-02 01:28

Well, for example, please see the attached image. It's a (not quite finished) modified ajaxian theme embedded in a wordpress page. I'd like to have something like this, but instead of embedding it in a page, embed it in a post so users can flip through images, comment via the post comments, etc while reading the text. Does this make sense?

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Fri, 2007-11-02 02:25

Yes, it kind of makes sense. But I'd think you might want any comments on the images to be done via the G2 comment system. That way, if you ever dump WordPress as your blog software, you'll still have the image comments available. (There's going to be something come along some day that's better. The WordPress development model can't keep up with some of the changes on the horizon, like switching to PHP5 only and all of the class goodness that that brings...) Just a thought...

You could still do what you want to do with all of the images just inserted in a post, use LightBox, and then they can flip through them in a more visually pleasing way and then still comment on the images using WP's comment system. You don't need a truly embedded page to do that, you just need the images, right?

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
DMstr

Joined: 2007-10-31
Posts: 7
Posted: Wed, 2007-11-07 09:27

I agree that commenting via Gallery2 would be preferable...but the reason I've shied away from it is because of the tremendous spam problem. Even with Captcha enabled I tend to get several new spam comments a day, and without a bulk-delete option this becomes quite overwhelming. If there's a better solution for this I'd be overjoyed but I've searched the forums a bit and haven't come across anything yet...so for now I just disabled gallery's comments altogether.

Using lightbox would be a possible solution, but it's not exactly what I was hoping for - by embedding the entire gallery in the post I can take full advantage of Gallery's nested albums structure, subscribe to feeds, etc. It just seemed like, if embedding "Gallery" into a page is possible, it wouldn't be too tough to also embed it into a post, perhaps with some slight code modification...?

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-11-07 13:04

I haven't tested this, but you could try changing the 'post_type' => "page", to 'post_type' => "post", in the two time that wp_insert_post is used in wpg2functions.inc. That should create a post instead of a page. But it also may cause an unstoppable chain reaction that destroys the world.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
DMstr

Joined: 2007-10-31
Posts: 7
Posted: Wed, 2007-11-07 14:42

Hmm...but that would just create a single post with an embedded gallery rather than letting me embed the gallery (& its subalbums) in any post I like, right? I'm looking for a way to do it from the post-side (like how we embed images in the post), not the wpg2 config side.

For example, right now you can embed the entire gallery (which is effectively just the top-level album) in a single page, or a single image in any post. I'd like to embed any album in any post (similarly to how we embed any image in any post).

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-11-07 15:49

I see what you're saying, but I don't think there's any way to embed it in more than one post. Just like you can't embed it in more than one page. We use the embedded page ID (an integer identifying that page) throughout WPG2 and it has to be unique. That's how we know that we need to get the gallery for that specific page and not another one. Without a fairly serious hack to allow embedding on multiple posts/pages, you just can't do what you want to do.

(Just getting it to recognize multiple posts as needing to be embedded would be fairly easy. The hard part would be modding all of the other code that relies on the embedded page ID to be a single integer.)

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2007-11-07 21:36

I do not think this would be even possible, in order to get the WPG2 Output page we use the wordpress template redirect hook, as far as I am aware this hook only exists for pages not posts..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-11-07 22:15
ozgreg wrote:
I do not think this would be even possible, in order to get the WPG2 Output page we use the wordpress template redirect hook, as far as I am aware this hook only exists for pages not posts..

You're probably right. I was thinking that the hook applied to both pages and posts, keying on the post ID. But it makes sense that it only applies to pages. You probably don't want a separate template for posts. Now that I think it through, you'd get a new header and footer for each post, which doesn't work. So, I'm sure you're right...

Bottom line is that you can't embed the whole gallery in a post.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
gfindlay

Joined: 2006-07-06
Posts: 20
Posted: Fri, 2007-11-09 04:13

Try the "Page View" plugin for WP http://urbangiraffe.com/plugins/pageview/

It does an iframe thing. You give it a URL, title and description of the page and it embeds it in a post OR a page. So you could give it the URL of the gallery album you want to embed and voila.

Look at my test here http://bytor.co.uk/pvt and navigate around the embedded site to see what you get. You can change most of the look as its done in CSS.

That help?

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Fri, 2007-11-09 13:30

Gfindlay,

Great find! Thanks for posting that. It looks like it will do what DMstr wants to do.

We'll have to look at how they're doing that and see if it's worth incorporating the same technique in a future version of WPG2, or just post a link to the plugin in our FAQ.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website