Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Off Topic / Other:
Image List

 

 


socanews
User

Mar 11, 2011, 7:50 AM

Post #1 of 5 (10668 views)
Shortcut
Image List Can't Post

Is it possible to set up images i use regular under a section editor for eg. Images.
Then access the Images list within other Section Editors?
Joseph


Jason
Staff / Moderator


Mar 11, 2011, 10:07 AM

Post #2 of 5 (10665 views)
Shortcut
Re: [socanews] Image List [In reply to] Can't Post

Hi Joseph,

CMS Builder stores uploaded images to be for a specific section and record. CMS Builder currently doesn't support a way of creating a central bank of images.

Hope this helps clarify.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


socanews
User

Mar 11, 2011, 10:16 AM

Post #3 of 5 (10664 views)
Shortcut
Re: [Jason] Image List [In reply to] Can't Post

I think waht i am trying to say is. could I add images to a Section Editor as though i was adding a record.
So i then build up a Section Editor called Images which contains all the images I use on a regular basis.
When i next create an article i can select the image from within the Images (Section Editor).
Hope this all make sense.
Joseph


Jason
Staff / Moderator


Mar 14, 2011, 9:35 AM

Post #4 of 5 (10552 views)
Shortcut
Re: [socanews] Image List [In reply to] Can't Post

Hi Joseph,

What would happen in that scenario, is all those uploads would be labeled as being attached to the section you uploaded them to. We don't currently have a way of taking an upload from one section and copying it to another.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


gkornbluth
Veteran

May 2, 2011, 7:37 PM

Post #5 of 5 (8876 views)
Shortcut
Re: [socanews] Image List [In reply to] Can't Post

Hi Joseph,

Sorry, but I didn't notice your post until just now. Here's a recipe from my CMSB Cookbook http://www.cmsbcookbook.com that describes how to do what I think you're after.

Best,

Jerry Kornbluth

DISPLAYING IMAGE(S) FROM A MASTER IMAGE LIBRARY IN YOUR VIEWERS

Here’s a way to use a master image library and not have to re-upload your images each time you want to use them.

It developed because user Deborah wanted to be able to select the specific logo(s) that were displayed on a set of detail pages from a database of previously uploaded logo images.

After a little help from Chris from Interactive Tools, here’s what Deborah came up with. I hope you find it useful.

SECTION EDITORS
You'll need to create a multi-record editor called “Logo Uploads” with a “Title” text field for the name of the logo and an “Upload” field called “logos” for the logo images.

You’ll also have to create a multi-record editor called “Programs” where you’ll create your “products” records and decide which logos are to be shown on each product detail page.

In the “Programs” editor you’ll also need to create a multi value pull down (or checkbox) list field called “logos”.

For the “List Options” for this field, choose “Get options from database (advanced)”, Section Tablename: “logo_uploads”, Option Values: “num”, and Option Labels “title”.

For the Viewer URLs > detail page URL, enter /logotestdetail.php

After you’ve uploaded some “logos” and created some “product” records it’s time create your test list and detail viewers.

VIEWERS
The list viewer will be called “logotestlist.php” and the detail viewer will be called “logotestdetail.php”

The list viewer is a standard viewer which you can create from the code generator for the “Programs” editor.

The detail viewer has a few modifications, but start with the standard detail viewer that’s generated by the code generator, and then at the top of the viewer, add the following code after the get records call:


Code
<?php //display logos selected from list in other table, note both tables have same field name of 'logo' 
$numsTabbedList = $programsRecord['logo'];
$numsTabbedList = trim($numsTabbedList);
$numsCommaList = str_replace("\t", ",", $numsTabbedList);
if ($numsCommaList) {
list($logo_uploadsRecords,) = getRecords(array(
'tableName' => 'logo_uploads',
'where' => "num IN ($numsCommaList)",
'allowSearch' => '0',
));
}
else { $logo_uploadsRecords = array(); // empty array
}
?>

And in the body of the viewer where you want your logos to appear, add this code (page styling is up to you):

Code
<?php foreach($logo_uploadsRecords as $logo_uploadsRecord): ?> 
<?php foreach ($logo_uploadsRecord['logo'] as $upload): //display logos selected from list in logo_uploads table ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><?php endforeach ?>
<?php endforeach ?>

You can download a set of ini.php files and a list and detail viewer from:

http://www.thecmsbcookbook.com/downloads/logos.zip
Sorry, you'll have to supply your own images.

** DON’T FORGET TO CHANGE THE “LOAD VIEWER LIBRARY - $dirsToCheck PATH IN THE VIEWERS TO YOUR SERVER PATH.

After you’ve got the example working, you can add any required fields and style the pages the way you’d like.

Have fun...

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
http://www.thecmsbcookbook.com