re-directing a page with one item

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 7, 2009   (RSS)

Re: [Carrie] re-directing a page with one item

By ross - April 27, 2009

Hi Carrie

Thanks for posting!

That is an interesting requirement. I think I'll need to take a closer look at how you have your system setup though. Could send me some FTP details to your server through consulting@interactivetools.com? If you could pop a link to this email thread in there as well, that would be great!

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [Carrie] re-directing a page with one item

By ross - May 7, 2009

Hi Carrie

I have an idea for you. It doesn't actually involve redirecting though. Basically, when you are on a list page, you can display any field you like so you can actually turn your list page into a full detail page if you like. The main difference is that it will display a full detail page for every single record it returns so you could end up with a single page that shows all the details about 10 different records.

With me so far?

My idea is to figure out how many records are going to be appearing on your list page. If it's just a single record, then you would display it as a full detail page. If there are more than one records, you display it as a list page.

The code to get that going will look something like this:

<?php foreach ($productsRecords as $record): ?>
<?php if (count($productsRecords) > 1): ?>
CODE FOR REGULAR LIST PAGE GOES HERE
<?php else: ?>
CODE FOR FULL DETAIL PAGE GOES HERE
<?php endif; ?>
<?php endforeach; ?>


You'll see where you need to put your detail page code and your list page code from there.

Does that make sense? To make it easier, I recommend starting by having just one field display. Summary in the first part and Content in the second.

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/