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

Home: Products: CMS Builder:
Moving to next and previous whilst in detail view (not in list view)

 

 


zaba
User

Nov 18, 2008, 8:31 AM

Post #1 of 3 (305 views)
Shortcut
Moving to next and previous whilst in detail view (not in list view) Can't Post

Hi,
I am trying to create next and previous links on a news detail page which would in theory load the same page with the next or previous record. The page would initially have been loaded from a link in the news listing page. I have set up the pages to my design etc but I am stuck on how i could do this from a detail page.
Any help would be greatly appreciated.

code from the listing page


Code
<?php 
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/removed on purpose/public_html/cmsAdmin/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '10',
));

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<table width="559" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="newspagehead">SCS Group news centre</td>
</tr>
<?php foreach ($newsRecords as $record): ?>
<tr>
<td valign="top" class="newshead"><img class="newsarrowpad" src="/gfx/newsarrow.gif" alt="" width="16" height="12" /><?php echo $record['title'] ?></td>
</tr>
<tr>
<td valign="top" class="newssnippet"><p class="_5"> <?php foreach ($record['image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img class="newsthumbpad" align="left" src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $record['title'] ?>" />

<?php elseif ($upload['isImage']): ?>
<img class="newsthumbpad" align="left" src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $record['title'] ?>" />
<?php endif ?>
<?php endforeach ?>

<?php echo $record['summary'] ?></p>

<p class="_0">[ <a class="qlmenu" target="content" href="<?php echo $record['_link'] ?>">Read More</a> ]&nbsp;&nbsp;<span class="released">Date released <?php echo date('d.m.Y', strtotime($record['date'])); ?></span></p>
</td>
</tr>
<tr>
<td valign="top" class="newsrule"><img src="/gfx/dot509.gif" alt="" width="509" height="1" /></td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>


And this is the detail page



Code
<?php 
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/removed on purpose/public_html/cmsAdmin/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$newsRecord = @$newsRecords[0]; // get first record

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="559" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="newspagehead">SCS Group news centre</td>
</tr>
<tr>
<td valign="top" class="newshead"><img class="newsarrowpad" src="/gfx/newsarrow.gif" alt="" width="16" height="12" /><?php echo $newsRecord['title'] ?></td>
</tr>
<tr>
<td valign="top" class="newssnippet">
<?php foreach ($newsRecord['image'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<img class="newsthumbpad" align="left" src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $newsRecord['title'] ?>" />
<?php endif ?>
<?php endforeach ?>
<?php echo $newsRecord['content'] ?>

</td>
</tr>
<tr>
<td valign="top" class="newssnippet">

<p class="_0">[ <a class="qlmenu" href="<?php echo $newsMetaData['_listPage']; ?>" target="content">Back</a> ] < <a class="qlmenu" href="#" target="content">Previous</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a class="qlmenu" href="#" target="content">Next</a> >&nbsp;&nbsp;[ <a class="qlmenu" href="#" target="_blank">Print</a> ]&nbsp;&nbsp;<span class="released">Date released <?php echo date("d.m.Y", strtotime($newsRecord['date'])) ?></span></p></td>
</tr>
</table>
</body>
</html>



Dave
Staff / Moderator


Nov 18, 2008, 2:01 PM

Post #2 of 3 (303 views)
Shortcut
Re: [zaba] Moving to next and previous whilst in detail view (not in list view) [In reply to] Can't Post

Hi Zaba,

Have a look at this post:
http://www.interactivetools.com/iforum/P66131#66131

Dave Edis - Senior Developer
interactivetools.com


zaba
User

Nov 18, 2008, 2:06 PM

Post #3 of 3 (301 views)
Shortcut
Re: [Dave] Moving to next and previous whilst in detail view (not in list view) [In reply to] Can't Post

Perfect, thanks!

 
 
 


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