1 (edited by tianxu 2016-09-13 15:27:55)

Topic: Embed in Muse

Hi StevenI want to do exactly the same thing, can you help me?
Ive made a gallery on svbuilder, with my flickr pictures.
I've got this code
<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

gallery folder is:
/Users/tian/Desktop/WEBSITE TIAN/simpleviewer

index page name is:index.html

I want to put it in Muse. I've tried using base URL, but i don't know what to replace "http://www.example.com/mygallery/" with, and whatever i try it doesn't work.
i have version 2.3.2

thanks

Re: Embed in Muse

I would certainly recommend using the baseURL method of embedding as documented here.
You would upload the complete gallery folder (not just the contents) to your web server which might help keep things organized as the gallery will be completely self-contained within its own folder.
Also, it does not matter where on your web server you upload your gallery folder to as long as the two paths in the embedding code (the path to the 'simpleviewer.js' file and the baseURL itself, pointing towards the gallery folder) are correct.

Here's an example you can follow.

(1) Create a gallery with svBuilder and save it to a folder named 'my_gallery'.
(2) Upload the complete gallery folder to the root directory of your web space. If your domain is www.example.com (for example), then you should now be able to view your gallery on a page of its own at http://www.example.com/my_gallery/index.html
(3) Now, to embed your gallery in a web page alongside other content, you can use the following code. The leading slashes in the paths mean that the paths are relative to your root directory so the code will work in any page throughout your site without modification.

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="/my_gallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
    var flashvars = {};
    flashvars.baseURL = "/my_gallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "100%", "600", "222222", true, flashvars);
    });
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

(You can change the gallery's dimensions and background color in the Embed Code Parameters if you like.)

Please note that the gallery will not appear in the Muse preview but will be fine once everything has been uploaded to yuor web site.

Steven Speirs
SimpleViewer Support Team

Re: Embed in Muse

Is there any way I can preview it before I upload? because I don't want to keep uploading in order to just see it.

Thanks

Re: Embed in Muse

Use relative paths in your gallery's embedding code (for the path to the 'simpleviewer.js' file and for the baseURL).
The paths should be relative to the web page containing the embedding code.

For example, if your gallery folder is named 'my_gallery', then make sure that the gallery folder is in the same directory as the web page containing the embedding code and use the following as the embedding code:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="my_gallery/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
    var flashvars = {};
    flashvars.baseURL = "my_gallery/";
    simpleviewer.ready(function () {
        simpleviewer.load("sv-container", "100%", "600", "222222", true, flashvars);
    });
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

Note that the paths no longer have a leading slash. The leading slash denotes that the paths are relative to the root directory (and this will work only when uploaded to a web server).
Relative paths without the leading slash are relative to the page that the paths are in (and this works locally as well as when uploaded to a web server).

Steven Speirs
SimpleViewer Support Team