Web Design Sussex :: Web Design Tutorials
 
 

How can we help you?

 
 

Services by business type

 
 

Latest articles

Medium Sized Business Solutions – They do Exist
Do you sometimes feel that your business is stuck between a rock and a hard place? Is your business too large for small…
read more…
The Database and how it benefits the Small Businesses
The shift from performing tasks manually to placing the strain on IT systems in business continues to advance. Whether…
read more…
Starting up in Business? Need a Low Budget Online Presence? Static Brochure Websites are the Solution
Static brochure websites from Core Media Design; quality website design on a budget especially designed for start ups…
read more…
How to Get a Premium Quality Website without Breaking the Bank
A poorly designed and hard to navigate website that does not showcase a company’s services and products can become an…
read more…
Promoting your Business Online: Why you Need to employ Social Networking
Are you on Facebook? Do you Tweet, or blog? If you answer 'No' because you think you're too busy running your business…
read more…
Search Engine Copy writing: Don't go too far - remember your visitors!
You've set up an attractive website. You've done your research and compiled a list of keywords and phrases that should…
read more…
Corporate Branding: Why you need to match your Online Profile with your Offline Profile
Does image matter? In the competitive world of corporate business the answer is a definite Yes! Having a strong and…
read more…
How Online PR can Boost your Search Engine Ranking
Designing a fantastic website is just the beginning. To attract the maximum number of potential customers, your website…
read more…
Keywords: you know you need them in your web content - but are you using the right ones?
According to new research from Hitwise, there has been a noticeable change in the way web users are inputting keywords…
read more…
Accessibility: What it is and why you need to make sure your Website has it
Website accessibility: boost your chances of online success by making sure your website is accessible to the widest…
read more…
How to Stop Competitors Stealing your Customers
How often do you contact your customers? Do you keep in touch with them regularly? Do you remind them of your products…
read more…
Boost your Small or Start up Business: Get a Website!
If you are starting a new business or running a small company and don't have a website, you could be seriously losing…
read more…
Link Building: Another Good Way to improve your Search Engine Ranking
The more websites you have linking to your website, the more highly the search engines rate the importance of your…
read more…
Using Web Syndication to Promote your Website
Web syndication explained: why RSS feeds and Podcasts are important online promotion tools that every website should…
read more…
Does your website meet the needs of your customers?
Web statistics show lots of site visitors but few sales? Improve your visitor to customer conversion rate by tailoring…
read more…
Pay-Per-Click Advertising versus Organic Search Listings
Starting out on the road to online promotion? Then you will no doubt be facing the same dilemma that every website…
read more…
How can I improve my search engine ranking? Golden rule: don't use underhand tricks!
Search engine optimisation is complex and should be left to the experts where possible. However, website owners should…
read more…
Is your Website up to Speed?
Google research says slower websites receive less traffic and is penalising advertisers with slow loading pages.…
read more…
Christmas 2008 - it's confirmed: High Street Sales fall as Online Sales Rise
According to Experian, in comparison with December 2007 there was a 2.3% drop in people visiting shopping centres and…
read more…
Ecommerce Law: Is your Website and Online Activity Legal?
Ecommerce Law: Is your online activity legal? If you trade online you must take steps to ensure you comply with the…
read more…
Search Engine Users are Search Savvy: Does your Website have the right keywords to attract the right people?
The words and phrases used to search for products or services are of vital importance to an online marketing campaign.…
read more…
Why Credit Crunch Cutbacks Must NOT affect your staff training programme
Cutting back on staff training to save money during the credit crunch could have long-term negative consequences.…
read more…
Save time and money by using your website to its full potential
Businesses looking to save money should put their website at the top of their problem solving list. Providing it is…
read more…
Multimedia Transforms the way we Learn
Multimedia uses images, animation, video and audio to make an impressionable impact, far advanced from the effects of…
read more…
Website Accessibility, Optimisation and Testing: Why you won't sell a thing without them
A website can make a significant difference to business turnover; providing it works. Just because you can browse your…
read more…
Free Website Warranty: Peace of Mind in Highly Competitive Times
What do you do if the website you've paid good money for doesn't work properly? And what if it's got lots of useful…
read more…
Online Shopping: Good for the Environment; Good for the Wallet
Retailers should never assume that as long as they have an online shop, customers will find it and buy from it. They…
read more…
 

Web Design Tutorials

Category: Dreamweaver tutorials

Go back
 
 

Image Gallery using Spry framework

This tutorial will explain how to create image gallery (thumbnail viewer) using Spry Widgets which come together with Dreamweaver CS3. Download the style sheet used in this tutorial by clicking on the download button on the right.

Download | Demo
preview

Create the following folders and sub folders:

images/large
images/thumb

and files, directly in your site's root folder:

data.xml
index.html

Prepare 6 different images and resize them to something like width 339px - mine are 339px wide and 254px high. Place all of then inside of the images/large folder. You will also need to create thumbnails for them with the same name as the large ones, but much smaller. For this purpose I have resized and cropped all images so that the thumbnail has a shape of square rather than rectangle.

I have chosen the dimensions: 50px / 50px.

Place your thumbnails inside of the images/thumb folder.

Now it´s time to prepare our xml file which will store all necessary information about our images. Open data.xml and after the line which reads <?xml version="1.0" encoding="utf-8"?> type:


<imageset>
<image>
<imgfile>001.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
<image>
<imgfile>002.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
<image>
<imgfile>003.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
<image>
<imgfile>004.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
<image>
<imgfile>005.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
<image>
<imgfile>006.jpg</imgfile>
<imgthumbwidth>50px</imgthumbwidth>
<imgthumbheight>50px</imgthumbheight>
<imglarwidth>339px</imglarwidth>
<imglarheight>254px</imglarheight>
</image>
</imageset> 

Save and close the file.

Now open the index.html file and attach the style sheet which you have downloaded at the beginning of this tutorial.

In between the <body></body> tags type:

<div id="wrap">
<div id="limg">
<img src="#" width="" height="" alt="" />
</div>
<div id="cont">

</div>
</div> 

Now from the Bindings tab of the Application panel choose Spry XML Data Set (Fig. 01).

fig_01

Fig. 01

In the Spry XML Data Set window, give your data set a name - I have just left it as ds and attach our data.xml file by clicking Browse button and pointing to its location. Once the file has been attached click Get schema button to retrieve the schema of the xml file.

In the Row element section, select the image node and click OK to create a data set (Fig. 02).

fig_02

Fig. 02

Save the file and in the window which will pop in click OK to indicate that you´ll remember to copy dependent files (generated by Dreamweaver) to your remote server (Fig. 03).

fig_03

Fig. 03

In the Bindings section of the Application panel you should now see our data set (Fig. 04).

fig_04

Fig. 04

Still in the Code view, place your cursor after the <div id="cont"> line and change the view to Design. From the Spry tab of the Insert panel choose Spry Table (Fig. 05).

fig_05

Fig. 05

In the Insert Spry Table window check Update detail regions when row is clicked and click OK (Fig. 06).

fig_06

Fig. 06

Now change the view to Code and identify our table:


<table>
<tr>
<th>Imgfile</th>
<th>Imgthumbwidth</th>
<th>Imgthumbheight</th>
<th>Imglarwidth</th>
<th>Imglarheight</th>
</tr>
<tr spry:repeat="ds" spry:setrow="ds">
<td>{imgfile}</td>
<td>{imgthumbwidth}</td>
<td>{imgthumbheight}</td>
<td>{imglarwidth}</td>
<td>{imglarheight}</td>
</tr>
</table> 

We will convert our table to unordered list (&lt;ul&gt;).

First of all completely remove the following content:


<table>
<tr>
<th>Imgfile</th>
<th>Imgthumbwidth</th>
<th>Imgthumbheight</th>
<th>Imglarwidth</th>
<th>Imglarheight</th>
</tr>

and:


<tr>
<td>{imgfile}</td>
<td>{imgthumbwidth}</td>
<td>{imgthumbheight}</td>
<td>{imglarwidth}</td>
<td>{imglarheight}</td>
</tr>
</table>

This way we are only left with:

<tr spry:repeat="ds" spry:setrow="ds">

Change the tr to li and at the end of this line type the closing &lt;/li&gt; tag. Your line should now look like this:

<li spry:repeat="ds" spry:setrow="ds"></li>

Now place your cursor at the beginning of this line and type:

<ul id="ulthumb">

and after closing &lt;/li&gt; tag type closing &lt;/ul&gt; tag. The entire line should now read:

<ul id="ulthumb"><li spry:repeat="ds" spry:setrow="ds"></li></ul>

We need to insert an image tag for the thumbnail in between the &lt;li&gt;&lt;/li&gt; tags. After &lt;li spry:repeat="ds" spry:setrow="ds"&gt; type:

<img src="images/thumb/{imgfile}" width="{imgthumbwidth}" height="{imgthumbheight}" alt="{imgname}" />

The names within the curly brackets {} are the names of tags from our xml file which populate relevant information for each record.

If you test your page in the browser you should now see a list of 6 thumbnails displayed horizontally as in Fig. 07

fig_07

Fig. 07

Go to the Design view, click on the upper image placeholder and then click &lt;div#limg&gt; tag selector (Fig. 08).

fig_08

Fig. 08

Now from the Spry tab of the Insert panel choose Spry Region (Fig. 09).

fig_09

Fig. 09

In the Insert Spry Region window select DIV and Detail region, from the Spry Data Set choose our data set ds and for Insert select Wrap selection and click OK (Fig. 10)

fig_10

Fig. 10

Change the view to Design and identify the line which reads:

<img src="#" width="" height="" alt="" />

Remove the hash (#) symbol and in its place type images/large/.

Now from the Bindings section of the Application panel drag and drop imgfile to the end of the src path. Your src path for the image should now look like this:

<img src="images/large/{ds::imgfile}" width="" height="" alt="" />

Do the same with the width, height and alt attributes assigning the following:

width: imglarwidth
height: imglarheight
alt: imgfile

Your image in the Code view should now look like this:

<img src="images/large/{ds::imgfile}" width="{ds::imglarwidth}" height="{ds::imglarheight}" alt="{ds::imgfile}" />

ou can add another tag to your xml file which would store some more meaning full name for the image and replace the alt tag value with it. The same if you'd like to display some description for each image.

Save and test the file by clicking thumbnails to change main image. And that's it there is to it.

 

Category: Dreamweaver tutorials

Go back
 

All rights reserved © Website Design Company :: Core Media Design Limited 2004 – 2010
Core Media Design Limited is registered in England No 6557241

Back to top
 ;

Explore in further details…

  • Multimedia Design
    Multimedia presentations weave realism and excitement into any project and help to deliver an influential message.
  • Training Sessions
    Do your personnel lack the software skills and knowledge they need to help your business grow and develop?
  • Website Design Company
    An all-embracing web development service where breathtaking website design blends with skilled database and ecommerce...

And other…

 ;