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

Home: Products: CMS Builder:
Help with thumbnail displays

 

 


mateo
User

Mar 14, 2008, 10:15 AM

Post #1 of 7 (624 views)
Shortcut
Help with thumbnail displays Can't Post

I have exactly what I want hard coded at http://thomaspaintingllc.com/references.php

I just want to make the two images on the left sidebar editable by CMSBuilder. I've set up a section called sidebar_images and set the thumbnail size to be right for these, but I can't figure out how to call those thumbnails correctly.

What's the correct way to call the thumbnails and info1 text for both images and not interfere with my page content call?

Thanks in advance for the help!


Dave
Staff / Moderator


Mar 14, 2008, 11:36 AM

Post #2 of 7 (619 views)
Shortcut
Re: [mateo] Help with thumbnail displays [In reply to] Can't Post

Hi mateo! :)

You have sidebar images throughout the site right?

I'd suggest adding a field called 'section'. Then give it a value of 'services' and upload all the images for the services page on that record.

Then just use a regular page viewer to show the images like this. The only difference is we'll rename some of the variables.


Code
<?php 
require_once "lib/viewer_functions.php";
$sidebarOptions = array();
$sidebarOptions['tableName'] = 'sidebar_images';
$sidebarOptions['recordNum'] = ''; // use where below:
$sidebarOptions['where'] = 'section = "services"';
$sidebarRecord = getRecord($sidebarOptions);
?>


Then display your images like this:


Code
<?php foreach getUploads($sidebarOptions['tableName'], 'uploads', $sidebarRecord['num']) as $upload) ?> 

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

<?php endforeach ?>


See if you can get that far and let me know how it goes. If that works well you can add a record 'sidebar_images' for each page on the site (and add viewers for them).

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


mateo
User

Mar 14, 2008, 1:22 PM

Post #3 of 7 (616 views)
Shortcut
Re: [Dave] Help with thumbnail displays [In reply to] Can't Post

OK, set that all up and I'm getting this error:


Quote
Parse error: syntax error, unexpected T_STRING, expecting '(' in /mnt/Target01/337632/351436/www.thomaspaintingllc.com/web/content/test.php on line 75


Here is what I have for php code. (Line 75 is the "foreach getuploads" line:



Code
<?php  
require_once "lib/viewer_functions.php";
$sidebarOptions = array();
$sidebarOptions['tableName'] = 'images';
$sidebarOptions['recordNum'] = ''; // use where below:
$sidebarOptions['where'] = 'Page = "references"';
$sidebarRecord = getRecord($sidebarOptions);
?>

and


<?php foreach getUploads($sidebarOptions['tableName'], 'uploads', $sidebarRecord['num']) as $upload) ?>

<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /><br/>
<div class="caption"><p>
<?php echo $upload['caption'] ?><br/>
</p></div>


<?php endforeach ?>



Dave
Staff / Moderator


Mar 15, 2008, 2:38 PM

Post #4 of 7 (579 views)
Shortcut
Re: [mateo] Help with thumbnail displays [In reply to] Can't Post

Ahh, sorry about that typo. Change this (add "(" before getUploads and ":" after $upload)):


Code
<?php foreach (getUploads($sidebarOptions['tableName'], 'uploads', $sidebarRecord['num']) as $upload): ?>


and if you still get errors make sure require_once is set to the right path for your server (just copy the line from one of your other viewers or the code generator):


Code
require_once "/path/on/your/server/lib/viewer_functions.php";


And for your caption used 'info2' (or which ever info field your caption is stored in, info2 is default) like this:


Code
<?php echo $upload['info2'] ?>


Hope that helps! Let me know if there's any other problems with that.

Dave Edis - Senior Developer
interactivetools.com


mateo
User

Mar 20, 2008, 9:00 AM

Post #5 of 7 (503 views)
Shortcut
Re: [Dave] Help with thumbnail displays [In reply to] Can't Post

Now I'm getting this:

Page Viewer (images): MySQL Error: Unknown column 'Page' in 'where clause'

Yet, in the screenshot below you can see that I have these fields..
Attachments: Picture 1.png (76.9 KB)


Dave
Staff / Moderator


Mar 20, 2008, 10:48 AM

Post #6 of 7 (499 views)
Shortcut
Re: [mateo] Help with thumbnail displays [In reply to] Can't Post

Hi Mateo,

Try replacing $upload['Page'] with $upload['info2'].

All the extra upload "info" fields are named info1, info2, etc. The name you specify is just for display purposes only when the user is uploading images.

When modifying code just use the 'info#' fieldname that is displayed beside the field in the field editor.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


rasbro
User

Mar 20, 2008, 6:53 PM

Post #7 of 7 (480 views)
Shortcut
Re: [Dave] Help with thumbnail displays [In reply to] Can't Post

Hi Dave and mateo!

I just wanted to say thanks for this great post. This is exactly along the same lines as an issue I have been struggling with. Your post has helped me solve the problem. It's times like this when I really appreciate forums! Thanks to you and many others who contribute in the forums so we can all benefit and learn from each other.

Take care,
Brian

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
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