CMS Builder for Gallery

9 posts by 3 authors in: Forums > CMS Builder
Last Post: July 2, 2008   (RSS)

By matrix - June 17, 2008

I thought I could do this, but maybe not.

Building a gallery for an artist, and what I need is a section where the list viewer displays thumbnail images for a gallery of images. Each thumbnail is linked to the detail page where the larger image is displayed.

Did that. So far, so wonderful.

But now I'm stuck on the Detail Page. I really need Next & Previous links on each Detail Page for sequential navigation through the individual image pages if someone doesn't want to return to the section list (thumbnail display) each time.

Is there any way to do this and maintain the thumbnail display with the 15 or 20 images we anticipate for each section?

Please say yes and tell me what I've been missing. I think that all the postings I've read refer to the List Page only, and we need that page to work as described.

Thank you!
Happy Interactive Tools product user since 1999

Re: [matrix] CMS Builder for Gallery

By Dave - June 18, 2008

Hi Matrix,

There's no automatic way to do this. If you can take it as far as you can, then create a mockup of how the image detail page should look with prev and next links, I can help you with it.

Just send me the urls, FTP and CMS login details to dave@interactivetools.com (email, don't post login details to the forum) and I'll see what I can do and post back here for everyone who wants to do the same kind of thing.

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

Re: [Dave] CMS Builder for Gallery

By matrix - June 18, 2008

Wow, this is great! I'm really excited about our possibly getting next and previous links for these pages...would make this full-fledged gallery software for those who don't want all those comments and rating systems...professional artists and photographers, for instance.

Excellent idea for news stories, too, keeping visitors around.

Email to you with access information follows.

Thank you so much!!!
Happy Interactive Tools product user since 1999

Re: [matrix] CMS Builder for Gallery

By Dave - June 19, 2008

Hi Matrix, I've emailed you about this. Feel free to email me back if there's any other issues.

This was another case of wanting << prev and next >> links on detail pages so users can page through without having to go back to the list page.

A lot of people have been asking for this so I've put together an experimental new feature that supports it. Note that this may not work well sections with many records (1000+) but it's a good work around for now.

Here's how to do it. Add this code to your viewer file or /lib/viewer_functions.php (it will be in the next release):

// Note: This function is EXPERIMENTAL and may change in future
function getPrevAndNextRecords($options) {

// error checking
if (!@$options['tableName']) { $errors .= "No 'tableName' value specified in options!<br/>\n"; }
if (!@$options['recordNum']) { $errors .= "No 'recordNum' value specified in options!<br/>\n"; }

// load ALL records matching
list($records, $metaData) = getRecords(array(
'tableName' => $options['tableName'],
));

// get prev and next records
$prevRecord = array();
$nextRecord = array();
$foundRecordNum = false;
foreach ($records as $record) {

// set next record
if ($foundRecordNum) { $nextRecord = $record; break; }

// set prev record
if ($record['num'] == $options['recordNum']) { $foundRecordNum = true; }
if ($foundRecordNum) { $prevRecord = @$lastRecordSeen; }
$lastRecordSeen = $record;
}

return array($prevRecord, $nextRecord);
}


Then add this code to the bottom of step 1 in your detail viewer:

list($prevRecord, $nextRecord) = getPrevAndNextRecords(array(
'tableName' => 'news',
'recordNum' => getNumberFromEndOfUrl(),
));


Then add this where you want your prev/next links to go:

<?php if (@$prevRecord): ?>
<a href="<?php echo $prevRecord['_link'] ?>"> &lt;&lt; <?php echo $prevRecord['title'] ?></a>
<?php endif; ?>

<?php if (@$nextRecord): ?>
<a href="<?php echo $nextRecord['_link'] ?>"><?php echo $nextRecord['title'] ?> &gt;&gt;</a>
<?php endif; ?>


Hope that helps, let me know if you have any questions or problems with this.
Dave Edis - Senior Developer
interactivetools.com

Re: [matrix] CMS Builder for Gallery

By matrix - June 19, 2008

This is exactly what we needed! It is perfect.

Thank you so much. Having the ability to add this to the detail pages opens up a whole new world of possibilities. For instance, in addition to the gallery feature we're building, it's a great way to prompt visitors to move on to the next article.

Your support absolutely can not be beat. The BEST!

Thank you.
Happy Interactive Tools product user since 1999

Re: [matrix] CMS Builder for Gallery

By chassa2556 - July 1, 2008

Hi Matrix

Could you publish a link to show how this works on the actual site please? I'd be interested to see how the interface works.

thanks

Re: [chassa2556] CMS Builder for Gallery

By Dave - July 1, 2008

This is an experimental feature, but basically it lets you add links to the bottom of your pages like this:

<< prev record - next record >>

That let you page through the records without having to go back to the list page. What the function does is get you the links for those. The text can say whatever you want (or be a graphic).

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

Re: [matrix] CMS Builder for Gallery

By chassa2556 - July 2, 2008

Thanks very much matrix I have just built our first site in CMS builder but got a bit out of my depth so IT had to take over.

But I agree I like the program I just need to see some good practical solutions. I also need to build a site myself from the ground up so I get an idea of the logic. I'd be really grateful if you could get the go ahead from your client to send me the link. charles.dewey@gmail.com