Sub Detail page for images

8 posts by 2 authors in: Forums > CMS Builder
Last Post: September 22, 2009   (RSS)

Re: [gkornbluth] Sub Detail page for images

By Chris - September 19, 2009

Hi Jerry,

Can you please post the PHP source code for the detail page that shows a series of thumbnails from a specific gallery?
All the best,
Chris

Re: [chris] Sub Detail page for images

By gkornbluth - September 19, 2009 - edited: September 22, 2009

Chris,

Thanks for this.

Each guide_dog_images record has a group code, (this group is called Rob) one image upload and a few descriptive text fields.

I’d like to be able to show the larger version of the image and some of the descriptive text when someone clicks on the thumbnail.

The current code in the first detail page is:

In the head:

list($guide_dog_imagesRecords, $guide_dog_imagesMetaData) = getRecords(array(
'tableName' => 'guide_dog_images',
));


And in the body:

<table cellpadding="10">
<tr>
<?php foreach ($guide_dog_imagesRecords as $record): ?>
<?php foreach ($record['image'] as $upload): ?>
<td width="125" height="125" bgcolor="#C0BCB3" align="center" valign="middle">
<a href="<?php foreach ($guide_dog_name_detailsRecords as $record): ?><?php echo $record['_link'] ?><?php endforeach; ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight']?>" border="0" style="margin-bottom: 5px" /></a>
<?php $maxCols=7; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?PHP endif; ?>
<?php endforeach ?>
<?php endforeach; ?>
</tr>
</table>



I know that the code for the _link is not going to get me where I need to go, but I don’t know what to replace it with and what other code is needed.

Best,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Sub Detail page for images

By Chris - September 21, 2009

Hi Jerry,

Where does $guide_dog_name_detailsRecords get set?

Also, are you uploading multiple images per guide_dog_images record, or is there one image uploaded per record?
All the best,
Chris

Re: [chris] Sub Detail page for images

By gkornbluth - September 21, 2009 - edited: September 22, 2009

Chris,

My client trains guide dogs. Each dog goes through about a year of training. She's a photographer, so she takes many images to document the year long task.

She will soon have 10 or 15 dogs, (groups) on her list page.

Each of the detail pages has a long description of the particular dog, with maybe 100+ image thumbnails documenting the year.

When a thumbnail gets clicked on, instead of just seeing a larger image on a white background as you do now, she'd like a sub-detail page that shows a larger image of that specific thumbnail, a description of what went on when that image was taken, as well as some other info taken from the fields of the "Guide Dog Images" record.

She's been using her pbase page to accomplish the bare bones of this idea but wants to expand the concept and keep everything on her own web site.

At present, I've set up 3 editors:

1) Guide Dog Names - multi record - where the dog groups are created. A single "Title" field only. Allows client to add new groups at will.

2) Guide Dog Name Details - multi record - One record for each group. Each record contains a radio button list to specify the group name, a list page image upload field, and group description field.

3) Guide Dog Images - multi record - All image are uploaded here for all groups. One image per record. Each record contains a radio button list to specify the group name the image belongs to, a narrative field about that particular image and some other information fields.

If you need to access the editors or the site, post your e-mail address I'll send you the log in info.

Many thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Sub Detail page for images

By Chris - September 21, 2009

Hi Jerry,

One image per guide_dog_images record? Perfect! :)

You'll want to use the '_link' for the guide_dog_images record, then supply a Detail Page URL for that section.

For example:

<table cellpadding="10">
<tr>
<?php foreach ($guide_dog_imagesRecords as $record): ?>
<?php foreach ($record['image'] as $upload): ?>
<td width="125" height="125" bgcolor="#C0BCB3" align="center" valign="middle">
<a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight']?>" border="0" style="margin-bottom: 5px" /></a>
<?php $maxCols=7; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?php endif; ?>
<?php endforeach ?>
<?php endforeach; ?>
</tr>
</table>


Please let me know if you have any problems with that approach, or if you have any more questions.
All the best,
Chris

Re: [chris] Sub Detail page for images

By gkornbluth - September 21, 2009

Thanks Chris for all the time you put into this.

I don't know why I couldn't see the simplest of solutions.

I didn't define the second detail page... Duh

I really hate it when I can't I think straight!!!

It's time for a vacation.

Jerry [:(]
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Sub Detail page for images

By Chris - September 22, 2009

Hi Jerry,

No worries! Glad this worked for you. :)
All the best,
Chris