using iframe need any image description links to open new window?

mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Wed, 2011-04-27 20:22

I searched google for "bbc open in new window" and a thread here popped up but its really old.

So I was wondering if anyone knows how I can put external links in my image titles/descriptions that will open in a new windows?

I want to use a some linkage to get user back to main site after viewing images in Gallery2 should they have entered through a Google search and be outside my iframe.

Thanks for any help! :)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-04-27 21:13

try embedding w/out the iframe.
I have many tools here.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Wed, 2011-04-27 22:01

Thanks suprsidr, appreciate the help. I tried without the iframe and it seems like the same result, no new window. :(

Your site looks amazing! The G2 Bridge is very interesting, I wish it was for joomla as well!! 80

I got some screen to show what I'm trying here on my current install..

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Wed, 2011-04-27 22:02

holy crap that screen shot is 681KB !!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-04-27 22:20

you can include jQuery in your page somewhere(joomla may already)
and hijack all thumbnail links to add target="_blank"

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript">
        jQuery('#gsThumbMatrix a').each(function(){
            $(this).attr('target', '_blank')
        });
    </script>

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Wed, 2011-04-27 22:54

Wow , that would be pretty cool! I have no idea where to even put that though. Can we do it for just the Gallery2 pages and not all of my joomla pages?

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Wed, 2011-04-27 22:58

Appreciate the help btw! I might just have to build my next site with geeklog<>gallery2 :)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2011-04-27 23:43

you can add my code to the bottom of gallery2/themes/your theme/templates/local/album.tpl <- you can copy the original here.
like this:

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript">
        {literal}
        jQuery('#gsThumbMatrix a').each(function(){
            $(this).attr('target', '_blank')
        });
        {/literal}
    </script>

both the carbon and matrix themes make use of gsThumbMatrix, another theme may use another element.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Thu, 2011-04-28 00:22

I thought that might be the spot. Didn't seem to work though, no change visible on front end.

Could I just add a html banner in the album.tpl? I just need to figure out how to position something. Directly under the large image might be a good spot, I think. Then I could use the previous spot for descriptions. btw the album is here...

(little banner in bottom right side)
http://www.nicecarvings.com/gallery/main.php?g2_itemId=65

Here it is with iframe in joomla:
http://www.nicecarvings.com/gallery/local-gallery

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-04-28 00:34

photo.tpl displays the individual photos whereas album.tpl displays the thumbs.

BTW from here the thumbs do force a new window which is what I thought was the idea.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Thu, 2011-04-28 01:16

Wow, thats pretty cool, seems a little heavy on the new windows though.

Is there a way to make just the little banner in description area open a new window from page view ?
http://awesomescreenshot.com/0f3c31ed1

If not, perhaps I can hard code a similar banner into the photo page with html and include the target=_blank ? Would do that in photo.tpl ?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-04-28 01:47

in photo.tpl where you want the link to show use something similar to:

<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"}" target="_blank">View in new window</a>

if you want to show just the image in the new window:

<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}" target="_blank">View in new window</a>

of course you can substitute and image for the text.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
mjindustry
mjindustry's picture

Joined: 2011-04-27
Posts: 16
Posted: Thu, 2011-04-28 03:09

thanks for all the help suprsidr. I can't get that to work. check this out! I think we can get this using the bbc codes. I think we make the changes in lib>smarty_plugins>modifier.markup.

I found an old thread
http://gallery.menalto.com/node/37003

Now I'm close to getting it. But the code in there is a little different now then when that post was made.

I can't get the target=_blank to work in here?
Line: 190

Quote:
return sprintf('<img src="%s" alt=""%s/>', $content, $size);

No matter how I put the target=_blank it doesn't quite work. This is where we can make this happen though! I think. 8

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-04-28 03:14

nope
you realize that when you change a template, you need to clear the template cache to see changes.
FAQ: How can I clear cached data?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2011-04-28 04:44
mjindustry wrote:
The G2 Bridge is very interesting, I wish it was for joomla as well!!

His stuff is indeed great.

Good news for you is that the JoomG2 Bridge, which does away with JFusion, the iframes it comes with and the attendant issues, is undergoing beta testing and will be released shortly.

--
dakanji.com