Hand coded detail links and permalinks.

2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 16, 2014   (RSS)

By gregThomas - May 16, 2014

Hi Ron,

With the permalinks you can still pass values into the URL, so you could have a permalink for the $prerecord record and pass in the category as well. For example, you could modify the code so that URL's look like this:

/this-is-a-permanlink?pg=4

You could set up the section that contains the records so that the list and detail pages are index.php. Then if you modified your link creation code to use the permalink and category like this:

    $prodLink = '/'.$precord['_link'].'?pg='.$precord['category'];

When a permalink is used that links to a record, the num value is passed into the request array. So say my this-is-a-permalink permalink was for record 12 in a section called cars. Then $_REQUEST['num'] would be automatically set as 12 when the detail page loads. Then you could just modify your code so that instead for $_REQUEST['item'], it looks for $_REQUEST['num']:

$pageNum = isset($_REQUEST['pg']) ? $_REQUEST['pg'] : null;
$detailNum = isset($_REQUEST['num']) ? $_REQUEST['num'] : null; 
if(!$pageNum)$pageNum = 1;

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com