Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
CMS going great BUT challenge with 2 image situations

 

 


equinox69
User

Feb 17, 2008, 1:31 AM

Post #1 of 6 (539 views)
Shortcut
CMS going great BUT challenge with 2 image situations Can't Post

Hi!
I'm a newbie with NO pHp or MySQL direct experience but CMS, with the help of Dave and Co., is really easy for the most part. I have one challenge and a related question...
first, here is the list url to show how far I am and where I'm at:
http://www.graddysequipment.com/customList.php

1) How do I get a single thumbnail (first one uploaded) to appear on the List page?

and,

2) How come the title and caption for the photos are not appearing on the custom records pages? How do I correct that?

Thanks for your expeditious help in advance!

Terry


Dave
Staff / Moderator


Feb 17, 2008, 9:11 AM

Post #2 of 6 (524 views)
Shortcut
Re: [equinox69] CMS going great BUT challenge with 2 image situations [In reply to] Can't Post

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.


Code
<?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


equinox69
User

Feb 17, 2008, 6:42 PM

Post #3 of 6 (512 views)
Shortcut
Re: [Dave] CMS going great BUT challenge with 2 image situations [In reply to] Can't Post

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.

Terry


Dave
Staff / Moderator


Feb 17, 2008, 10:04 PM

Post #4 of 6 (503 views)
Shortcut
Re: [equinox69] CMS going great BUT challenge with 2 image situations [In reply to] Can't Post

Ok, try adding these tags to customPage.php:


Code
<?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


equinox69
User

Feb 20, 2008, 4:35 PM

Post #5 of 6 (417 views)
Shortcut
Re: [Dave] CMS going great BUT challenge with 2 image situations [In reply to] Can't Post

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.graddysequipment.com/customList.php


Dave
Staff / Moderator


Feb 21, 2008, 1:18 PM

Post #6 of 6 (385 views)
Shortcut
Re: [equinox69] CMS going great BUT challenge with 2 image situations [In reply to] Can't Post

Looking good, that first one with the treads looks like it would be fun to drive around! :)

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4