How simple would this be?

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 15, 2011   (RSS)

Hi all,

I am looking to achieve what I hope is a simple task.

I am looking to add a list of titles from a cmsb blog "list page" on the "detail page", the idea being that each detail page of the blog showing the main article content will also have links to previous articles in a column on the same page.

My assumption is that if I take the main routine which is provided for the "list page" and strip out all the fields except the "title" field this will produce a list of all the titles for that blogger which will then link to the detail page for each title.

My only concern is in my belief that the header information for a list page is different to that provided for the detail page so I am unsure as to whether trying to provide information (or use a routine) designed for a list page on a detail page will work (if you know what I mean).

If someone could advise if this is possible and what I need to do about the header info it would be greatly appreciated.

Thanks in advance for any help provided.

Re: [willydoit] How simple would this be?

By Jason - November 15, 2011

Hi,

The header code (ie, the code that connects to CMS Builder) will be the same for any page, either a list or a detail page. So you won't have any trouble there.

The best approach would be to do two getRecords queries: 1 to get the detail record (you probably already have this on your page) and 1 to get a list of all the blog records (this will be used to make your list).

For example:

//get blog detail page
list($blogRecord, $blogMetaData) = getRecords(array(
'tableName' => 'blog',
'where' => whereRecordNumberInUrl(1),
'limit' => 1,

));

$blog = @$blogRecord[0]; //get first record

// get list of all blog records
list($allBlogRecords, $allBlogMetaData) = getRecords(array(
'tableName' => 'blog',
'allowSearch' => false,
));


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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