Allowing g2embed to open a gallery directly
October 16th, 2007Sometimes you want embedded gallery to open a gallery in the blog frame, sometimes you want it just to link to the full gallery and have it completely redraw the screen. The difference is a link in your imageblock that is either /gallery/v/SomeAlbum vs. /blog/v/SomeAlbum. The first will render the album in a new gallery frame. The second will render the album within your blog entry. The embedded developers requested an override so that the G2 url creation method could do either. If you want your imageblock to render the album in a new frame make the following changes:
In ImageBlockHelper.class, go to near the bottom of the loadImageBlocks() method. Below the line that says $ImageBlockData[’forceFullUrl’]=1, add another variable to the ImageBlockData array: $ImageBlockData[’forceDirect’]=1. This will send a message to the template to force a direct url (instead of a blog url) when creating the url. You have to do one more thing though. The template itself needs to be told what to do with the new data member. Open up ImageBlock.tpl and find the calls to g->url. Change them so that there is one more argument passed in: {g->url arg1=”view=core.DownloadResize” arg2=”itemId=`$block.id`”
forceFullUrl=$ImageBlockData.forceFullUrl forceDirect=$ImageBlockData.forceDirect}
forceDirect will tell the url creation method to only use the /gallery url instead of the /blog url. Your image blocks will now all open into a new gallery frame.


