Piwigo.org

You are not logged in. (Register / Login)

Announcement

#1 2012-06-29 18:24:20

RWH
Member
Registered: 2012-03-07
Posts: 9

Linking to External Albums

Can anyone advise me on this please?
I am trying to set up a new Piwigo gallery with albums for each year and sub-albums for each location. In most cases I can simply upload photos. But I sometimes get contacted by people who have published a related set of photos in an album of their own on an external web-site.
I would like link to these in a way that opens a new browser window. I want to link to the external album, not to the individual photos within that album. And I would need to put the link within the sub-album for the appropriate year.
The only topic I found about this in the forum said to create a new sub-album and change it's description to:
    <script>self.location.href='http://www.his_pictures.com/';</script>
This worked. I created an “external gallery” icon and uploaded it to the new sub-album. However:
1. The script entry shows against the external gallery icon.
2. The sub-album shows as containing one photo. If I move the icon to a separate private album, the sub-album doesn't show at all.
3. I have tried adding target="_blank" and target="_new" but I am unable to get it to open in a new tab or window.
Can anyone advise me whether I'm attempting something impossible here – or whether there is a better way of doing this?
Any help/suggestions appreciated.
I'm using Piwigo 2.3.5 and theme “Clear”.


Uploaded Images

Offline

#2 2012-06-29 22:36:02

flop25
Piwigo Team
Registered: 1970-01-01
Posts: 3538
Website

Re: Linking to External Albums

Hello
1 use extended description and the balise more
2 an empty album is always hidden
3 hum the target attribute is not in the new habbits of coding ;  but setting _blank should have worked. What's you code exactly, with target


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

#3 2012-06-29 23:09:32

RWH
Member
Registered: 2012-03-07
Posts: 9

Re: Linking to External Albums

Thank you. I have now installed the extended description extension, so I will experiment with that.
I'm not clear what you mean by "the balise".

I have tried various versions of code:
<script>
self.location.href="http://www.album_location.com/"
self.location.target="_new";
</script>

<script>
self.location.href="http://www.album_location.com/" target="_new";
</script>


<script>
self.location.href="http://www.album_location.com/" target="_blank";
</script>

Offline

#4 2012-07-03 22:47:31

RWH
Member
Registered: 2012-03-07
Posts: 9

Re: Linking to External Albums

I have now tried the Extended Description add-on. I put the re-direct command in the album description and included target=”_blank”.

This did not simply re-direct to the target site as I'd expected.
Instead, it opened up the dummy album I had set up - containing just the thumbnail (exactly as if there was just text in the album description).

But it inserted a note at the top of the page "This album is redirected to http://target-site.org".
It was only after spending some time clicking between the album and the thumbnail that I spotted this note. Yes, the link to the target site did then open in a new tab when clicked.

So this solution is not the one-step re-direct I was looking for and I found it very confusing until I spotted the note. I wouldn't want to implement this on my web-site.

Offline

#5 2012-07-04 13:58:17

flop25
Piwigo Team
Registered: 1970-01-01
Posts: 3538
Website

Re: Linking to External Albums

flop25 wrote:

Hello
1 use extended description and the balise more
2 an empty album is always hidden
3 hum the target attribute is not in the new habbits of coding ;  but setting _blank should have worked. What's you code exactly, with target

1 I'm talking about <!--more-->
3 well don't use the redirect tag from the plugin. It's not great indeed ^^
The problem is the script can't open in a new window without cheating a little :

Code:

<script>
window.open("http://www.album_location.com/");
window.history.back();
</script>

will work, if they don't have a javascript blocker/filtrer


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

#6 2012-07-04 17:05:30

RWH
Member
Registered: 2012-03-07
Posts: 9

Re: Linking to External Albums

Thank you Flop25.
I am now making progress on this.

The script you provided works - as long as I have pop-ups enabled. That's in Firefox. I haven't yet tried it in other browsers.

I now have two alternative scripts:
The first requires the user to right-click and select "Open in new tab":

<br/>
<b>Right-click to open in new tab</b>
<br/><br/><br/><br/><br/><br/>
<script>
self.location.href="http://www.album_location.com/"
</script>

The second automatically opens a new tab but gives the warning about enabling pop-ups.

<br/>
<b>This requires pop-ups enabled</b>
<br/><br/><br/><br/><br/><br/>

<script>
window.open("http://www.album_location.com/");
window.history.back();
</script>

I've added the line-breaks in order to push the display of the script below the visible window. The user can still scroll to it but I think this looks better than displaying the script. See screen dump.

The first is my preferred option, since I normally have Firefox set to block pop-ups and I assume others do likewise.

I think this is probably as good as I can get it.
Thanks for your help.

Offline

#7 2012-07-04 17:10:02

flop25
Piwigo Team
Registered: 1970-01-01
Posts: 3538
Website

Re: Linking to External Albums

If you write in the album description something like 'external website' or you will be redirecting on an other website ... people will knows they need to enable popup, well at least I would react like that


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013