listing page with images that link to listing
2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 28, 2010 (RSS)
By (Deleted User) - June 28, 2010
[font "Times New Roman"]2 simple questions:[/#000000]
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]I need the code to create a listing page that includes basic info for the listing like the name, address, etc. Is should also include a thumbnail of the image IF THERE IS AN IMAGE in the listing and the image should link to the listing. If there is no image, there should be a box with a message “no image available”.[/#000000]
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]Also, what is the best way to position the listing items? Tables? CSS?[/#000000]
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]We are replacing this page (done with Listing Manager) with CMS Builder:
[/#000000]http://www.koshertravelinfo.com/davendb/exec/search.cgi?search=1&perpage=5&sort_order=1,abc,forward&lfield4_match=San%20Diego&lfield5_match=CA
I have already done it for one client here, but got rusty since I did not work with CMS Builder for a while and it also does not have the code to display "No Image Available" if there is no image...
http://www.superiorlighting-nyc.com/exit_emergency/exit_emergency.php?type=Exit%20Lights
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]I need the code to create a listing page that includes basic info for the listing like the name, address, etc. Is should also include a thumbnail of the image IF THERE IS AN IMAGE in the listing and the image should link to the listing. If there is no image, there should be a box with a message “no image available”.[/#000000]
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]Also, what is the best way to position the listing items? Tables? CSS?[/#000000]
[font "Times New Roman"] [/#000000]
[font "Times New Roman"]We are replacing this page (done with Listing Manager) with CMS Builder:
[/#000000]http://www.koshertravelinfo.com/davendb/exec/search.cgi?search=1&perpage=5&sort_order=1,abc,forward&lfield4_match=San%20Diego&lfield5_match=CA
I have already done it for one client here, but got rusty since I did not work with CMS Builder for a while and it also does not have the code to display "No Image Available" if there is no image...
http://www.superiorlighting-nyc.com/exit_emergency/exit_emergency.php?type=Exit%20Lights
Re: [RapidWeb] listing page with images that link to listing
By Jason - June 28, 2010
Hi,
Using the code generator will give you pretty much all of the code you'll need. If you only want to display thumbnails when if an image exists, you'll need to change the code for that.
You could use something similar to this:
Obviously this is just an example, and you'd have to change names to match what you have in your database (ie. UPLOADFIELD with the name of the field where you're uploading the pictures) This will only output an image if an image has been uploaded and a thumbnail has been created for it. Otherwise it will output the text "No Image Available".
As for the question of Tables vs CSS, it comes down to personal preference. I find tables are usually quicker and easier, but there are others who would disagree. Chances are, the user will never know the difference, so go with whichever you're more comfortable with.
Hope this gets you started. Let me know if you run into any issues.
Thanks.
Using the code generator will give you pretty much all of the code you'll need. If you only want to display thumbnails when if an image exists, you'll need to change the code for that.
You could use something similar to this:
<?php if($record['UPLOADFIELD']): ?>
<?php $images = $record['UPLOADFIELD']; ?>
<?php foreach($images as $image): ?>
<?php if($image['hasThumbnail']): ?>
<img src="<?php echo $image['thumbUrlPath'];?>" width="<?php echo $image['thumbWidth'];?>" height="<?php echo $image['thumbHeight'];?>" />
<?php else: ?>
No Image Available
<?php endif ?>
<?php endforeach ?>
<?php else: ?>
No Image Available
<?php endif ?>
Obviously this is just an example, and you'd have to change names to match what you have in your database (ie. UPLOADFIELD with the name of the field where you're uploading the pictures) This will only output an image if an image has been uploaded and a thumbnail has been created for it. Otherwise it will output the text "No Image Available".
As for the question of Tables vs CSS, it comes down to personal preference. I find tables are usually quicker and easier, but there are others who would disagree. Chances are, the user will never know the difference, so go with whichever you're more comfortable with.
Hope this gets you started. Let me know if you run into any issues.
Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/