I have successfully embedded G2 into my personal website. Today I tried to add an External Random Photo Image Block to my homepage and I have a problem. If I click on the random photo, it does not use my embedUri or path. It opens up another window, directly accessing g2 as if it were standalone. Is there a way to change this or even remove the hyperlink altogether? I would preferably like for the embedded page to load with the appropriate photo, and for it load in the same window.
For example:
My homepage is located at www.mysite.com/project4.
My embedded gallery2 page is accessed via www.mysite.com/project4/index.php?page=photos.
Clicking on the random photo on my homepage calls up www.mysite.com/gallery2/main.php?.....
Posts: 8601
i think valiant may have fixed this just a day or 2 ago.. get the very latest code and give it a try.. valiant can give more details.
Posts: 32509
- get the latest nightly snapshot (/or the current cvs version).
- settings for GalleryEmbed::init call:
embedUri => 'index.php/?page=photos'
embedPath => '/project4'
realtiveG2Path => 'gallery2' (i guess, can't tell you that based on the information you gave us)
Posts: 7
I tried what you suggested and it still behaves the same way. The embedded gallery2 page works fine, but the random photos on my homepage still link directly to the gallery2 stand-alone directory. For now, you can view the site at: [url]www.fikesonline.com/project4[/url]. I am using today's version of the code (April 3rd), and below is my GalleryEmbed::init command:
Posts: 32509
I guess there's a misunderstanding here. for the random image blocks, you can't use the <?php @readfile('http://www.fikesonline.com/gallery2/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title'); ?>
way of imageblocks in index.php?page=home if you want it to link to the embedded G2. You have to use
1. GalleryEmbed::init
2. GalleryEmbed::getImageBlock (not sure about the function name, but you get the idea),
3. GalleryEmbed::done
even for the index.php?page=home page.
and if you already do this, please post the sourcecode of your index.php?page=home page, such that i can see where the problem is.
ps: loginRedirect should be 'index.php?page=home' in your case. or just ''.
Posts: 7
Do you mean I should use something like this?
So far I cannot get this to work at all.
Posts: 32509
yes, exactly. only, use it with correct params, not just "init()".
Posts: 7
Thanks for all the help. I finally got it working. For some reason, I had to move the code further up in my file to get it to work. I think it may have been conflicting with another php database script I was using.
Posts: 7
Now my question is:
How do I get image frames to work with the random image blocks on my homepage?
Posts: 102
I just did this. Check out this thread:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=28355