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

Home: Products: CMS Builder:
List and Detail pages

 

 


thedmp
User

Sep 27, 2008, 12:30 PM

Post #1 of 6 (377 views)
Shortcut
List and Detail pages Can't Post

Hello all.

I am a little confused about List and Detail pages.

I want to be able to create multiple pages per directory. So, for instance, if I make a section about dogs, I would like an index page and numerous other pages (like dog toys, leashes, dog food) in the same section. Then I would like to do a different page for, I dunno, Cats.

I have an html template setup. But I'm not sure what code to put on it. The List.php? The Details.php. I did the list and it put out all of the articles on that page and it was a mess. I did the Details code and I went to create new content and it overwrote the previous content.

So I'm just confused about how to create an index page and be able to easily create new content on the fly without having to keep going in and messing with the code.

Any help would be appreciated.

Dave


Mr Jim
User


Sep 27, 2008, 1:54 PM

Post #2 of 6 (370 views)
Shortcut
Re: [thedmp] List and Detail pages [In reply to] Can't Post

Dave,

Let's say that you want an index page-- a place where you're going to list the various articles that you have about dogs. To keep it simple, let's assume that all you're going to have on that page is the title of the article that, when clicked, will take you to the (detail) page that will display the full article.

First, make sure that the section you're using is a Multi Page type section. You can't get a List page on a Single Page type section.

Once that's done, select the section that you're working in within the Section Editor. Then click on the Viewer Urls tab up top and type in the names of a list page (let's call it dogIndex.php and a detail page ( dogDetail.php ). Then click on 'Save Details'.

Now, go back into that section and click on 'Viewer Code Generator'. Make sure the section that you're working on is selected in the drop down list, then select 'List Page' as the Viewer Type. Forget the rest for now and just click on the 'Show Code' button.

Copy all the code that's now showing into a page on your website called dogIndex.php.

If you browse this new page you should get a list of all the records that are in your database table that pertains to this section. You can edit the code that you pasted to remove things you probably don't need such as record number, content, etc., but for now just leave it alone.

Now you need to create the detail page that's going to display your articles.

In CMS Builder, go back into the 'Viewer Code Generator' area of the section in which you're working. This time, after making sure that the same section is showing up in the 'Select Section' drop down list, select 'Detail Page' as the 'Viewer Type'. Leave all the defaults, but notice that the Detail page is going to know what article to display because the record number of that article is going to be passed to it by the list page that you've created via the link url.

Click on the 'Show Code' button and copy all the generated code to a new page on your website called dogDetail.php. Save the file. It will be called from the dogIndex.php page when you click on a link.

That's it. Browse your dogIndex.php file, click a link, and you should see the full article load in dogDetail.php.

Hope this helps.

Jim
WebCamp One, LLC
The Web Done Right

(This post was edited by Mr Jim on Sep 27, 2008, 9:23 PM)


thedmp
User

Sep 27, 2008, 5:45 PM

Post #3 of 6 (349 views)
Shortcut
Re: [Mr Jim] List and Detail pages [In reply to] Can't Post

Jim, thanks for the detailed explaination. I will give it a go.


thedmp
User

Sep 27, 2008, 6:27 PM

Post #4 of 6 (344 views)
Shortcut
Re: [thedmp] List and Detail pages [In reply to] Can't Post

So now I have an index page that links to the details page, but those links are the url of that page and not the title of the page, so it makes a really long and ugly link. I don't suppose there is a way to have this link to the details page be the title of that page? Otherwise, I will need to go back in to the html and make a static link to the new page each time I create an article. Thanks again for the help.


Mr Jim
User


Sep 27, 2008, 6:48 PM

Post #5 of 6 (340 views)
Shortcut
Re: [thedmp] List and Detail pages [In reply to] Can't Post

On the dogIndex.php page, change:

_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>

to the following:

_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a><br/>

Jim
WebCamp One, LLC
The Web Done Right

(This post was edited by Mr Jim on Sep 27, 2008, 7:01 PM)


thedmp
User

Sep 27, 2008, 7:51 PM

Post #6 of 6 (331 views)
Shortcut
Re: [Mr Jim] List and Detail pages [In reply to] Can't Post

Yep, that did the trick. Thank you.

 
 
 


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