Viewing Article

No StarNo StarNo StarNo StarNo Star | May 21 2009, 2:32 PM | Print
How to open extra info in a popup window
This feature is only available to Online Galleries Full subscribers, as it requires access to the File Sharing tool.

There may be times when you wish to load additional information into a popup window from a link on your website. A popup window is a small, clean (without a lot of the normal browser toolbars) window that can be easily opened and closed without taking the user away from your website. To do this, please follow these steps.

First, create a text file that contains the content that you want to display in the popup window. For this example we will just use Lorem Ipsum followed by one of our uploaded images:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a tempor elit. Fusce nec nunc urna, a sodales mi. Fusce consectetur vestibulum urna, at cursus ante rhoncus ut.

Nunc bibendum pellentesque mattis. Vestibulum porta dolor ut est sodales sed blandit diam posuere. Proin volutpat congue tellus id pretium. Nunc sed dictum ligula. Mauris et vehicula orci. Etiam ut turpis eu sapien facilisis consectetur a vel nulla. Ut lacinia justo a augue blandit aliquet. Nulla quam nisi, blandit in pellentesque at, faucibus quis odio.

img src="images/one-of-your-uploaded-images.jpg" /


Please note that the img line above would need <> around it to form a proper html tag, but I had to remove them in order to post the line in this article.

When you're happy with your content, save it as a plain .txt file. In the Online Galleries content management system, go to

Advanced Tools / File Sharing

Browse for text file you just created and click upload. The file will upload and appear in a list down the bottom of the page. Next to the file name it will show the full address of the file, which will be something like:

http://www.yourdomain.com.au/ftp/info.txt

The important part there for this process is the file name

info.txt

which is what we will need to link to in our popup. Now we need to open the popup from a text link, which could be placed anywhere on your website. For this example, we will add it to a piece in a gallery. Go to

Gallery Content / Edit Gallery

and load the piece you wish to add the link to. Enter some text such as

Additional Info

Select the text, make it underlined and then click the link button. For the URL, replace http:// with

javascript:PopUp(400,300,'info.txt')

In the line above, 400 is the width of the popup window in pixels, 300 is the height of the window in pixels, and the final parameter is the name of the text file that you just uploaded. The width and height of the window can be changed to whatever you wish, and the file name should be changed to reflect the name of the file you uploaded.

Click OK to insert the link, then save the text for the piece. Launch your site, load the piece you added the link to, click the link and you should see a popup window open with the content you entered into the text file.