CMS going great BUT challenge with 2 image situations

6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 21, 2008   (RSS)

Re: [equinox69] CMS going great BUT challenge with 2 image situations

By Dave - February 17, 2008

Looking good! Here's how to do what you want:

To get images to display on the list page you just copy the "STEP3: Display Uploads" block from the page viewer to the list viewer.

If you want just the first image only, you can use add a tag to stop looping through the images after 1 ("break"ing out of the loop) . That looks like this: <?php break; ?>

And title and caption fields (or any extra info fields you've created for uploads) are available as info1, info2, info3, info4, info5. You'd display them like this: <?php echo $upload['info1'] ?>

Putting that all together you'd add something like this to step 2 (List Records) to your customList.php.

<?php foreach ($listRows as $record): ?>

...


<?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>" /><br/>
<?php echo $upload['info1'] ?><br/>
<?php echo $upload['info2'] ?><br/>
<?php break; ?>

<?php endif ?>
<?php endforeach ?>

...

<?php endforeach ?>


Let me know if that works for you or if you need additional details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMS going great BUT challenge with 2 image situations

By Codee - February 17, 2008 - edited: March 30, 2013

Dave,

1) for the single thumbnail on the customList.php page I think I can handle the info you gave. I'll write if I get into trouble.

2) for the other issue of title and caption fields...the problem IS ON the customPage.php...I don't want the captions and title on the customList.php page...so cutting and pasting from the customPage.php isn't the issue. The issue is that the captions and titles on the customPage.php aren't showing.

Re: [equinox69] CMS going great BUT challenge with 2 image situations

By Dave - February 18, 2008

Ok, try adding these tags to customPage.php:

<?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
...

<?php echo $upload['info1'] ?><br/>
<?php echo $upload['info2'] ?><br/>


...
<?php endforeach ?>


Basically you just need to manually add them. info1 is title and info2 if caption. Just copy and paste those tags where ever you want the title and caption to be.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMS going great BUT challenge with 2 image situations

By Codee - February 20, 2008 - edited: March 30, 2013

Dave,

finally got both image issues squared away, just took a little more finagling, and it works, thanks for the direction.
it's coming along nicely:
http://www.sitename.com/customList.php

Re: [equinox69] CMS going great BUT challenge with 2 image situations

By Dave - February 21, 2008

Looking good, that first one with the treads looks like it would be fun to drive around! :)
Dave Edis - Senior Developer
interactivetools.com