Topic: Direct linking issue

I've followed the instructions to implement the direct linking on my simpleviewer galleries (based on wordpress plugin). The #NUMBER successfully gets appended to the URL. However, changing the number does not navigate to the corresponding image and instead defaults to #1 again. This is only true on Chrome for Mac v10. Changing the URL on Firefox 4 for mac does not even reload the gallery.

What could the issue be?

Re: Direct linking issue

I'm not sure how well Direct Linking will work with Wordpress, but if you post your URL I will take a look.

Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

http://www.ritosgeles.lt/galerija/vasara

Thanks!

Re: Direct linking issue

Try using the following code instead. Remember to clear your browser's cache after making the change.

//SimpleViewer API setup
var svAPI; //svAPI is the object to call API methods on
//Called by SWF when API becomes available


function svComplete() {
    //console.log("SimpleViewer API Available");
    svAPI = document.getElementById('svInstance');
};

//Called by SWF when user views an image
function svImageChange(index) {
    imageID = index + 1
    SWFAddress.setValue("/" + imageID + "/");
}

//Called when browser back button is clicked
SWFAddress.onChange = function () {
    if (svAPI.getImageIndex() != getLocationIndex()) {
        svAPI.showImage(getLocationIndex());
    }
}

function getLocationIndex() {
    var path = SWFAddress.getValue();
    var arr = path.split("/");
    return arr[1] - 1;
}
Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

Mike,

thanks for the code. I've replaced the earlier code with this, but now it doesn't even append the #NUMBER.

The URL is the same

Re: Direct linking issue

It looks like you removed too much of the code, the embed portion of your code should look something like the following.

//JavaScript Embed
var flashvars12 = {};
flashvars12.galleryURL = "http://www.ritosgeles.lt/wp-content/uploads/12.xml";
//Set enableAPI to true to use JS API
flashvars12.enableAPI = "true";                     
//Set 'firstImageIndex' based on the 'index' query string parameter
flashvars12.firstImageIndex = getLocationIndex();

var params = {};            
params.allowfullscreen = true;
params.allowscriptaccess = "always";

var attributes = {};
//name and id should match getElementById() call above
attributes.id =  "svInstance"; 
attributes.name = "svInstance";

jQuery(document).ready(function () {
    SV.simpleviewer.load('sv-container', '80%', '80%', 'transparent', true, flashvars12, params, attributes);
});
Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

Added the embed bit. #NUMBER is still not there.

Re: Direct linking issue

You still have the extra chunk of embed code in your page at about line 143 to 151.


<!DOCTYPE html>
<html xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml" dir="ltr" lang="lt-LT"
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta charset="UTF-8" />
<title>Vasara - vestuvių ir bažnyčių puošyba, jaunosios puokštė | ritos gėlės</title>
<link rel="shortcut icon" href="http://www.ritosgeles.lt/wp-content/themes/geles/images/favicon.ico" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="http://www.ritosgeles.lt/wp-content/themes/geles/galerija.css" />
<script type="text/javascript" src="http://www.ritosgeles.lt/wp-content/themes/geles/js/cufon-yui.js"></script>
<script type="text/javascript" src="http://www.ritosgeles.lt/wp-content/themes/geles/js/helvetica_light_400.font(3).js"></script>
<script type="text/javascript">
Cufon.replace('#nav-main, h2', { fontFamily: 'helvetica_light', hover: true });
</script>
<link rel="alternate" type="application/rss+xml" title="ritos gėlės &raquo; Srautas" href="http://www.ritosgeles.lt/feed" />
<link rel="alternate" type="application/rss+xml" title="ritos gėlės &raquo; Komentarų srautas" href="http://www.ritosgeles.lt/comments/feed" />
<script type='text/javascript' src='http://www.ritosgeles.lt/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://www.ritosgeles.lt/wp-includes/js/jquery/jquery.js?ver=1.4.4'></script>
<script type='text/javascript' src='http://www.ritosgeles.lt/wp-content/plugins/wp-simpleviewer/svcore/js/simpleviewer.js?ver=2.1.2'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.ritosgeles.lt/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.ritosgeles.lt/wp-includes/wlwmanifest.xml" />
<link rel='index' title='ritos gėlės' href='http://www.ritosgeles.lt' />
<link rel='up' title='Galerija' href='http://www.ritosgeles.lt/galerija' />
<link rel='prev' title='Salonas' href='http://www.ritosgeles.lt/galerija/salonas' />


<!-- All in One SEO Pack 1.6.13.2 by Michael Torbert of Semper Fi Web Design[273,289] -->
<meta name="description" content="Vestuvių puošybos darbų galerija. Bažnyčių ir automobilių puošyba, jaunosios ir pamergių puokštės, pokylio salės ir stalo dekoras. Floristo konsultacijos." />
<link rel="canonical" href="http://www.ritosgeles.lt/galerija/vasara" />
<!-- /all in one seo pack -->
<meta property="fb:admins" content="518508744" />
<meta property="fb:app_id" content="206873566006196" />
<meta property="fb:page_id" content="232494002785" />
<meta property="og:image" content="http://www.ritosgeles.lt/wp-content/themes/geles/images/logo.png" />
<meta property="og:site_name" content="ritos gėlės" />
<meta property="og:title" content="Vasara" />
<meta property="og:url" content="http://www.ritosgeles.lt/galerija/vasara" />
<meta property="og:street_address" content="Laisves a. 9c, Prienai" />
<meta property="og:country_name" content="Lithuania" />
<meta property="og:email" content="info@ritosgeles.lt" />
<meta property="og:phone_number" content="8-319-60365" />
<meta property="og:fax_number" content="8-319-60365" />
<meta property="og:type" content="company" />

<script type="text/javascript" src="http://www.ritosgeles.lt/wp-content/themes/geles/js/swfaddress.js"></script>
<script type="text/javascript">

    //SimpleViewer API setup
    var svAPI; //svAPI is the object to call API methods on
    //Called by SWF when API becomes available

    function svComplete() {
        //console.log("SimpleViewer API Available");
        svAPI = document.getElementById('svInstance');
    };

    //Called by SWF when user views an image
    function svImageChange(index) {
        imageID = index + 1
        SWFAddress.setValue("/" + imageID + "/");
    }

    //Called when browser back button is clicked
    SWFAddress.onChange = function () {
       if (svAPI.getImageIndex() != getLocationIndex()) {
        svAPI.showImage(getLocationIndex());
        }

    }
    function getLocationIndex() {
    var path = SWFAddress.getValue();
        var arr = path.split("/");
        return arr[1] - 1;
    }

    //JavaScript Embed
    var flashvars = {};
    //Set enableAPI to true to use JS API
    flashvars.enableAPI = "true";                    
    //Set 'firstImageIndex' based on the 'index' query string parameter
    flashvars.firstImageIndex = getLocationIndex();

    //JavaScript Embed
    var flashvars = {};
    //Set enableAPI to true to use JS API
    flashvars.enableAPI = "true";                    
    //Set 'firstImageIndex' based on the 'index' query string parameter
    flashvars.firstImageIndex = getLocationIndex();
   
    var params = {};           
    params.allowfullscreen = true;
    params.allowscriptaccess = "always";

    var attributes = {};
    //name and id should match getElementById() call above
    attributes.id =  "svInstance";
    attributes.name = "svInstance";

    jQuery(document).ready(function () {
        SV.simpleviewer.load('sv-container', '80%', '80%', 'transparent', true, flashvars, params, attributes);
});
                       
</script>
</head>

<body>
<div id="header">
    <div id="share">
        <div id="fb"><script src="http://connect.facebook.net/lt_LT/all.js#xfbml=1"></script><fb:like href="" layout="button_count" show_faces="false" width="120" font=""></fb:like></div>
        <div id="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="RitosGeles">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
        </div>
        <div id="nav">
            <div id="nav-main">
            <ul>
            <li class="page_item page-item-2"><a href="http://www.ritosgeles.lt/apie-mus" title="Apie mus">Apie mus</a></li>
<li class="page_item page-item-11 current_page_ancestor current_page_parent"><a href="http://www.ritosgeles.lt/galerija" title="Galerija">Galerija</a></li>
                <li class="cat-item cat-item-1"><a href="http://www.ritosgeles.lt/category/naujienos" title="Peržiūrėti visus temos Naujienos įrašus">Naujienos</a>
</li>
            <li class="page_item page-item-39"><a href="http://www.ritosgeles.lt/paslaugos" title="Paslaugos">Paslaugos</a></li>
<li class="page_item page-item-13"><a href="http://www.ritosgeles.lt/kontaktai" title="Kontaktai">Kontaktai</a></li>
            </ul>
            </div>
            <div id="nav-sub">
            <ul>
            <li class="page_item page-item-524"><a href="http://www.ritosgeles.lt/galerija/pavasaris" title="Pavasaris">Pavasaris</a>
<ul class='children'>
    <li class="page_item page-item-399"><a href="http://www.ritosgeles.lt/galerija/pavasaris/velykos" title="Velykos">Velykos</a></li>
</ul>
</li>
<li class="page_item page-item-671 current_page_item"><a href="http://www.ritosgeles.lt/galerija/vasara" title="Vasara">Vasara</a></li>
<li class="page_item page-item-561"><a href="http://www.ritosgeles.lt/galerija/ruduo" title="Ruduo">Ruduo</a></li>
<li class="page_item page-item-487"><a href="http://www.ritosgeles.lt/galerija/ziema" title="Žiema">Žiema</a></li>
<li class="page_item page-item-372"><a href="http://www.ritosgeles.lt/galerija/gedulas" title="Gedulas">Gedulas</a></li>
<li class="page_item page-item-585"><a href="http://www.ritosgeles.lt/galerija/salonas" title="Salonas">Salonas</a></li>
            </ul>
            </div>
        </div>
    </div>
<div id="gallery">
            <script type="text/javascript">
var flashvars12 = {};
flashvars12.galleryURL = "http://www.ritosgeles.lt/wp-content/uploads/12.xml";

jQuery(document).ready(function () {
    SV.simpleviewer.load("flashContent12", "80%", "80%", "transparent", true, flashvars12);
});

</script>
<div id="flashContent12" >SimpleViewer requires JavaScript and the Flash Player.
<a href="http://www.adobe.com/go/getflashplayer/">Get Flash.</a></div>
    </div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'YOUR APP ID', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/lt_LT/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>

<!-- Google Analytics BEGIN -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4934027-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- Google Analytics END -->

</body>
</html>

Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

Mike,

I've removed the duplicate bit from the head section

jQuery(document).ready(function () {
        SV.simpleviewer.load('sv-container', '80%', '80%', 'transparent', true, flashvars, params, attributes);

The bit it the div id=gallery section is inserted by the simpleviewer Wordpress shortcode.

Still no luck with the #NUMBER

Re: Direct linking issue

Mike,

would you have any other suggestions?

Re: Direct linking issue

Any other suggestions? As a Pro customer I'm expecting at least a reply that resolution is unavailable at this time or smth...

Re: Direct linking issue

Sorry, I just moved and was off line longer then expected. The reason it is not working is the code in your head is using flashvars and not flashvars12, so in the head of your doc change var flashvars = {};  to var flashvars12 = {}; and then remove var flashvars12 = {}; from the JavaScript in your body.

This is the section you need to remove the var flashvars12 = {} from:

<script type="text/javascript">
var flashvars12 = {};
flashvars12.galleryURL = "http://www.ritosgeles.lt/wp-content/uploads/12.xml";
simpleviewer.ready(function () {
    simpleviewer.load("flashContent12", "80%", "80%", "transparent", true, flashvars12);

});
</script>
Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

Mike,

the issue is that the head element is the same for all of my gallery pages as it is a wordpress template file. If I specify flashvar12 it will only work with the gallery ID 12. There needs to be a way to specify head elements independently of the gallery used or somehow change the ID number dynamically.

Any ways to do this?

Thanks

Re: Direct linking issue

I said in my first post the using direct linking with Wordpress will have its issues and complications that you will have to over come. Please remember that the SimpleViewer API is technically provided as is without support.

You could try:

<script type="text/javascript">
var flashvars12 = flashvars;
flashvars12.galleryURL = "http://www.ritosgeles.lt/wp-content/uploads/12.xml";
simpleviewer.ready(function () {
    simpleviewer.load("flashContent12", "80%", "80%", "transparent", true, flashvars12);

});
</script>
Mike Richards
SimpleViewer Support Team.

Re: Direct linking issue

Mike,

from mine point of view (and I'm sure I'm not alone in this) linking to individual images and SEO are significant weaknesses in SimpleViewer's offering. I can only hope Simpleviewer team's position on this will change. From a customers point of view, I should really need to distinguish which feature is supported and which one isn't. The fact is - the feature that is a standard almost everywhere is not available with simpleviewer.

Re: Direct linking issue

I know it's a  long time since the last post in this thread.
But I have exact the same issue like italpasta :(

on my Website "http://schwabscantechnik.de/aktuelles/#6"

If I want to open a specific picture of the gallery it automatically jumps to "http://schwabscantechnik.de/aktuelles/index.html#1"
everytime.

It were great if anybody have a solution for this problem.
Thanks

Re: Direct linking issue

@scantechnik

Try removing the firstImageIndex="0" entry from your gallery's XML file: http://schwabscantechnik.de/aktuelles/gallery.xml

Steven Speirs
SimpleViewer Support Team.

Re: Direct linking issue

GOD BLESS YOU! It works. Thank you very very much!