I'm displaying product thumbnails with brief descriptions on web pages. Clicking
on the product does a javascript popup with larger image and detailed
description info passed to the javascript functions from the table data.
Products can change frequently, and I want to make the maintenance of this
info easier by non-techies (each product has an image name, image width
(currently not using getimagesize), a short description, and a long
description). Can't devote major time to this; using a MySQL database to store
the data is currently not feasible because of the time to create the
administrative interface.
There are two methods that I have been playing with, neither of which I'm crazy
about from the maintenance aspect.
=============== =============== =============== ==
Method 1 to display image - hard coded info in table, no php:
<td width="25%" align="center">
<a href="javascrip t:popUp('prod1/12345.jpg','lon g product description
text','300');">
<img src="prod1/12345_t.jpg" width="75" border=0></a>
<br>
<div id="productdesc ription">
prodcode<br>pro duct text
</div>
</td>
Problem is that it's too hard to find the pieces to modify and to easy to screw
up by Joe Noncoder.
=============== =============== =============== ==
Method 2 to display image using php:
<?php
// section preceding each TD element has unique product info
$filename="1234 5";
$thumbline_1="p rodcode";
$thumbline_2="p roduct text";
$longdesc="long product description text";
$imgsize=300;
?>
<?php
// functions not shown for brevity
$popinfo = buildpopup($fil ename, $longdesc, $imgsize);
$thumbnail = buildthumbnail( $filename);
?>
<td width="25%" align="center" valign="top">
<a href="javascrip t:popUp(<?php echo $popinfo; ?>);">
<img src=<?php echo $thumbnail; ?> width="75" border=0></a>
<br>
<div id="productdesc ription">
<?php echo $thumbline_1 . "<br>" . $thumbline_2; ?>
</div>
</td>
The second method is a bit easier to maintain for an end user, only because the
data to modify is clearly delineated.
=============== =============== =============== ==
Another possibility is to have separate include files for each product, but it
could be more unwieldy to deal with 300 or so separate product files.
I'm probably overlooking something more obvious. Other suggestions appreciated!
jw
--
jdub@nospamform e.com
on the product does a javascript popup with larger image and detailed
description info passed to the javascript functions from the table data.
Products can change frequently, and I want to make the maintenance of this
info easier by non-techies (each product has an image name, image width
(currently not using getimagesize), a short description, and a long
description). Can't devote major time to this; using a MySQL database to store
the data is currently not feasible because of the time to create the
administrative interface.
There are two methods that I have been playing with, neither of which I'm crazy
about from the maintenance aspect.
=============== =============== =============== ==
Method 1 to display image - hard coded info in table, no php:
<td width="25%" align="center">
<a href="javascrip t:popUp('prod1/12345.jpg','lon g product description
text','300');">
<img src="prod1/12345_t.jpg" width="75" border=0></a>
<br>
<div id="productdesc ription">
prodcode<br>pro duct text
</div>
</td>
Problem is that it's too hard to find the pieces to modify and to easy to screw
up by Joe Noncoder.
=============== =============== =============== ==
Method 2 to display image using php:
<?php
// section preceding each TD element has unique product info
$filename="1234 5";
$thumbline_1="p rodcode";
$thumbline_2="p roduct text";
$longdesc="long product description text";
$imgsize=300;
?>
<?php
// functions not shown for brevity
$popinfo = buildpopup($fil ename, $longdesc, $imgsize);
$thumbnail = buildthumbnail( $filename);
?>
<td width="25%" align="center" valign="top">
<a href="javascrip t:popUp(<?php echo $popinfo; ?>);">
<img src=<?php echo $thumbnail; ?> width="75" border=0></a>
<br>
<div id="productdesc ription">
<?php echo $thumbline_1 . "<br>" . $thumbline_2; ?>
</div>
</td>
The second method is a bit easier to maintain for an end user, only because the
data to modify is clearly delineated.
=============== =============== =============== ==
Another possibility is to have separate include files for each product, but it
could be more unwieldy to deal with 300 or so separate product files.
I'm probably overlooking something more obvious. Other suggestions appreciated!
jw
--
jdub@nospamform e.com
Comment