Topic: Wordpress Problem

I can't seem to get my slide show to work on my Wordpress development site.

It works perfectly in my current site's page, http://gsmile.org/photogallery.htm

It works perfectly in my html test page for my new WP site, http://gsmile.org/Word-Dev/junk-test.htm

But the exact same code doesn't work in my WP test page, http://gsmile.org/Word-Dev/patient-gallery/

I'm totally stumped! Can you help?

By the way, I installed the Kimili Flash Embed Plugin but I did not see the button described in your instruction: "In WordPress, create a new blog post. Click the "Insert Kimili Flash Embed" button to bring up the "Kimili Flash Embed Tag Generator" dialog box." So I never got beyond step #3.

Last edited by scorendesign (2016-12-04 23:44:07)

Re: Wordpress Problem

Here's the code:

<script type="text/javascript" src="photogallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">                           
var flashvars = {};
flashvars.baseURL = "photogallery/";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "540px", "450px", "FFFFFF", true, flashvars);
});
</script>
<div id="sv-container"></div>

Re: Wordpress Problem

But the exact same code doesn't work in my WP test page,

The paths in your gallery's embedding code in your WordPress test page are incorrect.
If using relative paths (rather than absolute paths), then the paths should be relative to the web page containing the embedding code.

Use either:

<script type="text/javascript" src="../../photogallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">                           
    var flashvars = {};
    flashvars.baseURL = "../../photogallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "540px", "450px", "FFFFFF", true, flashvars);
    });
</script>
<div id="sv-container"></div>

... or:

<script type="text/javascript" src="/photogallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">                           
    var flashvars = {};
    flashvars.baseURL = "/photogallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "540px", "450px", "FFFFFF", true, flashvars);
    });
</script>
<div id="sv-container"></div>

The first option above uses relative paths from your 'gsmile.org/Word-Dev/patient-gallery/' directory leading to your gallery folder.

The leading slashes in the paths in the second option above denote your root directory so this embedding code will work in any web page throughout your site without modification.

Incidentally, you do not need to use the Kimili Flash Embed Plugin. As far as I recall, this can be used to embed a SWF file directly into a web page but if you embed the SimpleViewer SWF file using this method, then your gallery will not benefit from Universal Playback (the ability for gallery images to be displayed in non-Flash-enabled browsers and devices).
Just continue to use the recommended embedding code as you are currently doing.

Alternatively, you might like to try WP-SimpleViewer, the dedicated SimpleViewer plugin for WordPress which allows you to create and embed SimpleViewer galleries directly into WordPress pages and posts from within the WordPress Dashboard without the need for any manual coding at all.

Steven Speirs
SimpleViewer Support Team

Re: Wordpress Problem

Thanks so much! Appreciate the fast response and great explanation. Exceptional! It's working now, using the second option you provided.

Sorry, I should know this about paths by now. Am I understanding correctly:

flashvars.baseURL = "photogallery/"; points to the root directory of http://gsmile.org?

flashvars.baseURL = "/photogallery/"; points to the root directory of the page that's calling "photogallery," namely the patient-gallery page (http://gsmile.org/Word-Dev/patient-gallery)?

Also, for some reason when I use a "code module" in my Divi theme, none of the code works. When I use a "text module," it works. Not your problem, just an extra kink. I've got a support request in to Divi for this.

Love SimpleViewer!

Re: Wordpress Problem

Divi support sent the code back this way, and it now works in both their "Text Module" and their "Code Module:"

<script type="text/javascript" src="/photogallery/svcore/js/simpleviewer.js"></script><script type="text/javascript"> var flashvars = {};flashvars.baseURL = "/photogallery/";simpleviewer.ready(function () {simpleviewer.load("sv-container", "540px", "450px", "FFFFFF", true, flashvars);});</script><div id="sv-container"></div>

Do you see any problem using this version of your code?

Re: Wordpress Problem

Divi requires no blank spaces in the code for their code module. Thanks.

Re: Wordpress Problem

flashvars.baseURL = "photogallery/"; points to the root directory of http://gsmile.org?

flashvars.baseURL = "/photogallery/"; points to the root directory of the page that's calling "photogallery," namely the patient-gallery page (http://gsmile.org/Word-Dev/patient-gallery)?

No. It's the other way around.
'photogallery/' is a relative path (relative to the web page containing the path).
'/photogallery/' is always relative to the root directory (no matter where the web page containing the path is).

Do you see any problem using this version of your code?

No problem at all. It's the same as my second suggestion (just without line breaks).

Other than making the code easier to read, the line breaks are not important in this case.
However, if you had a JavaScript comment somewhere within the code, then it would comment all JavaScript code until the end of the line. If your code did not have line breaks, then all subsequent JavaScript code would be commented out (and ignored by the browser). (This is just something to bear in mind when removing all line breaks. It does not affect your own code as you do not have any JavaScript comments.)

Steven Speirs
SimpleViewer Support Team