Viewer Detail page with multiple category outputs and styles

4 posts by 3 authors in: Forums > CMS Builder
Last Post: April 29, 2010   (RSS)

Re: [mark99] Viewer Detail page with multiple category outputs and styles

By ross - April 27, 2010

Hi there.

Thanks for posting!

Because you have several listing viewer pages, what I would do is just hardcode the link to your detail page on them.

On your big_cats view page, you can have something like:

<a href="big_cats_detail.php">

Now, you'll also need to have at least the record number in there as well so the detail page knows what record to load. That will make your link look like this:

<a href="big_cats_detail.php?<php echo $record['num'] ?>">

Of course, you might need to change the $record part. Now, one thing to keep in mind is that you can also add in other variables to that URL so it ends up being more descriptive. For instance, you could have the title of the record in there too like this:

<a href="big_cats_detail.php?<php echo $record['title'] ?> - <php echo $record['num'] ?>">

Just make sure to have the num field at the end.

Does that all make sense? Let me know what you think :).
-----------------------------------------------------------
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: [ross] Viewer Detail page with multiple category outputs and styles

By mark99 - April 29, 2010 - edited: April 29, 2010

Yes but then that will only output the data for a single category when I want the Detail page to be a summary of all categories.

Re: [mark99] Viewer Detail page with multiple category outputs and styles

By Jason - April 29, 2010

Hi,

So you want to have a single detail page that outputs information for all of the different categories, but each category will output different fields. Is that right?

If so, you could have a different database select for each of your categories. For example:

list($bigCatsRecords,$bigCatsMetaData)=getRecords(array(
'tableName'= 'products',
'where'=> "category LIKE '%big_cats%'",
));

list($bigFrogsRecords,$bigFrogsMetaData)=getRecords(array(
'tableName'= 'products',
'where'=> "category LIKE '%big_frogs%'",
));

...etc


Then you would individually output each of those in a separate loop. Example:

<?php foreach ($bigCatsRecords as $record): ?>
*OUTPUT FOR BIG CATS*
<?php endforeach ?>


<?php foreach ($bigFrogsRecords as $record): ?>
*OUTPUT FOR BIG FROGS*
<?php endforeach ?>

...etc


Does that sound like what you're aiming for? Let me know.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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