WORKING WITH CATEGORY FILTERS - LISTINGS PAGE ISSUES - Aug 2nd, 2010


chassa2556 was concerned that links on a listings page that were filtered by category were always going to the first
record detail page. Here’s what he said:

I have my 'see more' link going to:



<a href="involvedDetail.php?<?PHP echo $involvedRecord['num'] ?>"> see more </a>



I have set it up so it all goes to one section with a category filter. The trouble is it keeps going to the first
record. This is even though I am on the second or third record and am expecting it to go to the relating detail page.

This was his header code:



list($involvedRecords, $involvedDetails) = getRecords(array(
'Table name' => 'involved',
'where' => ' category = "Join Us" ',
));



Mr.Jim from WebCamp One was able to shed some light on the problem. He said:

I'm assuming that you have two pages: a list page and then a detail page. The detail page would be the one that pops up
when you click on 'read more'. I'm also assuming that you are restricting anything listed on your list page to items
that fall within the category "Join Us".

If I'm correct, try this:

1. In your list page, add the following line to your header code:



'where' => 'category = "Join Us"',


After you add that code, that 'where' statement should be the only 'where' statement in the list page's header code.

2. Remove that same line from the header on your existing detail page and replace it with the following lines:



'where' => whereRecordNumberInUrl(1),
'limit' => '1',



3. Finally, change the code in your list page to read:



<a href="involvedDetail.php?<?PHP echo $involvedRecord['_link'] ?>"> see more </a>



That seemed to do the trick for chassa2556.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service