Skip to main content
uniquereplete
Participant
October 16, 2015
Answered

How to add "next" and "previous" buttons to rotate through web app item detail pages?

  • October 16, 2015
  • 2 replies
  • 1374 views

My client is asking for "next" and "previous" buttons to move from the detail page of one web app item to the detail page of the next/previous item in the same web app. What's the best way to set that up? I know you can add pagination to a list of web app items on a page, but, since you're already viewing the detail page generated by the web app, is it possible to create something similar to move to the next item? Any information would be appreciated. Thanks!

This topic has been closed for replies.
Correct answer Rob Hecker2

Thanks for your reply, Nancy O.

Did I post this question in the wrong place? I haven't quite figured out these forums, so that's very possible... I'm talking about an Adobe Business Catalyst site that uses "web apps" to display user-created data. Actually, I thought this whole forum was dedicated to Business Catalyst. lol

BC employs tags like this one {module_referreraddress,_top,Previous}, which outputs a Previous link that returns the user to the top of page they previously viewed. The refer address module wouldn't work in this case, because the user didn't necessarily visit the previous web app item before the one he or she is currently viewing.

I'm solid in html and css, but the kind of high-level coding that Rob Hecker2 is describing is beyond me. I'm pretty sure Business Catalyst prevents any kind of server-side processing anyway. So, although I'm sure the data is stored in a database of some kind, I don't have direct access to it.


Based on what you have just added. It sounds like BC has a process to handle this. You will probably have more luck asking in that forum.

2 replies

uniquereplete
Participant
October 23, 2015

Got it: Business Catalyst

I'll start a new question over there. Didn't realize how the forums were arranged.

Thanks for your help!

Rob Hecker2
Legend
October 16, 2015

You have not given us the technical info necessary to give specific advice, but you would probably use a SQL query with a url parameter to identify the next record to display. Here is a possible code snippet:

<form action='' method = 'get'><input type='hidden' value='<?php echo $record_id ?>'/><button >Next</button></form>

//  then the processing script would include something like:

if (is_numeric($_GET['record_id'])){

require_once '../../data/your data connection script.php';
    $stmt = $dbh->prepare("SELECT * FROM the_table WHERE record_id > '".$_GET[record_id]."' ORDER BY date LIMIT 1");

require_once '../../details/.key_yoga_site_org.php';
    $stmt->execute();

if ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {

extract($result);

// now display the results

}

uniquereplete
Participant
October 21, 2015

Hi, Rob. Thanks for replying. What kind of technical info would you like? I'll be happy to supply it.

I was really hoping there would be an easy answer, like a special module tag I didn't know about.

Rob Hecker2
Legend
October 21, 2015

What kind of technical info would you like?

Is the content stored in a database?

Which kind of database (MySQL?)

Which programming language will you use (my example uses PHP)

My example uses PDO for a data connection