Topic: top.location

Hi,

I've just moved across from Flash (BananAlbum via JAlbum) and am currently re-building all my pages with JBox Pro.

One area that I've just realised is not catered for, is ensuring that a site cannot get 'orphaned' when it's usually viewed in an iFrame.  Rudin (BananAlbum developer) kindly added a parameter for top.location to the tools in JAlbum and I'm hoping that you may feel that this is something important.  What can be worse than anonymous work?

In the meantime :

I have this piece of javascript which should do the job, but don't know how or where to apply it to my galleries.  Could anyone shed some light?

<script type="text/javascript">
    if(top.location == window.location){
        top.location.href = 'http://www.grantsymon.com..........';
    }
    </script>

Grant

Re: top.location

Not sure what you are wanting to do here. Can you explain why setting ' top.location.href' is useful?

Re: top.location

Sorry ... should have been more explicit.

If you use JBox in an iFrame, then it is accessible 'outside' its iFrame.  People can go directly to the JBox page without seeing the rest of the page that is intended to be seen (the part outside the iFrame).

This is a particularly big problem because Google, Yahoo etc.'s web crawlers will find the metadata in the image files and will return them in searches.  When someone clicks on a search result to view an image, they are not taken to the intended website, but instead, directly to the JBox page.

The result is that images are found, reported and viewed in a TOTALLY ANONYMOUS way.  This is as bad as it can get for professional photographers.  Image theft is pretty rife and this just makes it even easier.

All it needs is for the gallery to have the top.location script and whenever anyone clicks on an image to open the page it's on (subsequent to an image search or a shared link)  they will be instantly taken to the top.location, which of course, will be the original intended site with the iFrame and all the logo/branding/copyright restrictions that are necessary in the ongoing fight against image theft and ... ensures that clients get the whole branding thing and are not left stranded in a meaningless page with no information.

Grant

Re: top.location

Your code should go in the <head> section of a Juicebox gallery's 'index.html' page (the page which is being loaded into your <iframe>).

Re: top.location

Thanks Steven.

( Can I make a request that this be a checkbox option in the JuiceBox Pro Builder app.?  Pretty simple to implement I would guess. )

Re: top.location

This code is only suitable for those who wish to embed their galleries in iframes and do not wish to allow their galleries to be viewed on pages of their own. This is likely to be a small subset of all users and we recommend using embedding code in preference to iframes as embedding a gallery in an iframe will limit its functionality (the 'Expand Gallery' button is disabled and the 'Back Button' will not work).
It is easy enough to copy and paste this code where necessary but we do not want to encourage users to do something (use an iframe) which will limit the functionality of the gallery.

7 (edited by gfs 2013-02-14 19:40:52)

Re: top.location

How exactly does 'embedding code' work compared to embedding in an iFrame?  I've looked on the JuiceBox site but can't find any explanations.   Does it allow me to place a gallery within a page wherever I want?  And does it preclude anyone from viewing that gallery on its own, without the page?

Here's my site : grantsymon.com.  Can I recreate this layout with an 'embedded gallery'?  (And not have the gallery orphaned as previously explained).

If I could get away from iFrames I'd be delighted.

Re: top.location

How exactly does 'embedding code' work compared to embedding in an iFrame?

All galleries are embedded using embedding code.
When using an iframe, the gallery is actually embedded using embedding code in the 'index.html' file and the 'index.html' file is then loaded into the iframe.

Does it allow me to place a gallery within a page wherever I want?

Yes. Instructions for 'Embedding in a HTML Page' can be found here.

And does it preclude anyone from viewing that gallery on its own, without the page?

When embedding a gallery in a web page alongside other content, a user will be able to view the gallery fullscreen by using the 'Expand' button (though you can also include the gallery's 'index.html' page and link directly to it if you like).

Can I recreate this layout with an 'embedded gallery'?

If you have uploaded a complete gallery folder to your web server, then you should be able to replace your iframe with the baseUrl embedding code as documented here.

9 (edited by gfs 2013-02-18 08:22:29)

Re: top.location

Thanks for the further explanations Steven.

Would it be possible, technically and in the interests of avoiding 'orphaned galleries', to have it so that when someone finds an image via a Google search or similar and the link is to the gallery itself and not the main website, instead of the gallery being opened alone and thus orphaned, rather it is opened into the main website (parent) where the visitor can then use the full-screen button if they want, which would mean that they are viewing a photographer's site as intended and not just some unidentified work on the internet?

IOW, can I have my cake and eat it, meaning; with the top-location effect, but also an embedded gallery rather than an iFrame?

Re: top.location

The gallery's own 'index.html' file is used only to display the gallery on its own page (for example if linking directly to the gallery of embedding it in an iframe).
If you are embedding the gallery in an existing HTML page alongside other content, then the gallery's own 'index.html' file is not required and you do not need to upload it to your web server.
Therefore any Google search result (we are currently investigating integrating SEO techniques into Juicbeox-Pro) will point to your own web page (and cannot possibly point towards the gallery's own 'index.html' page because it does not exist on the internet).

11

Re: top.location

This is great news Steven.

Can I request that the option to NOT upload the index.html file be made into a checkbox in the JBox software?  (With ideally a brief description of why not ... sadly, many pro photographers never really think about this stuff.)

Re: top.location

Without the 'index.html' file, JuiceboxBuilder-Pro would not be able to open the gallery in a browser to let the user see what the finished gallery looks like after clicking 'Save' (when the 'View in Browser' checkbox is selected).

13

Re: top.location

Despite this Steven, I think it should still be relatively simple to find an appropriate layout and description (help) to offer the choice to users.

Certainly, if ever you build ftp into JuiceboxBuilder-Pro it would be a simple choice to exclude the index from upload.